Updating an image end up deleting it
@d-mendoza 已經在處理了。
開始於 2019年2月8日。
評估
這個 Issue 還沒有評估資料。
描述
Hi,
I'm using ActiveAdmin, with CarrierWave (1.3.1) and Cloudinary (1.11.1) with Ruby 2.4.4 (same issue with ruby 2.5.3) and rails 4.2.1.
My issue is the following one:
If I create a new record with an image, it works fine and I can see this image on my Cloudinary dashboard. However, when I try to update my record for a new image, none of the two images are on my dashboard anymore, and the URL stored in my record's attribute leads to a 404. However, the old version of the image is still available using the previous record's attribute's URL.
My guess is that there is either an issue with the cache like spotted in the issue #314, or an issue with carrierwave handling of cloudinary versions. However, the weirdest part is this deletion, and the fact that there is no trace of any image in my dashboard after update.
For more information, here are examples of my uploaders (feel free to ask for more information):
class BaseUploader < CarrierWave::Uploader::Base
include Cloudinary::CarrierWave
cloudinary_transformation backup: Rails.env.production?
def public_id
"#{store_dir}/#{model.id}"
end
def extension_white_list
%w(jpg jpeg gif png)
end
def cache_dir
"#{Rails.root}/tmp/uploads"
end
def filename
"#{public_id}.#{file.extension}" if original_filename.present?
end
protected
def store_dir
"#{Rails.env}/#{model.class.to_s.underscore}/#{mounted_as}"
end
end
class TeamMemberPictureUploader < BaseUploader
version :thumb do
process resize_to_fill: [300, 300]
end
end
class TeamMember < ActiveRecord::Base
mount_uploader :picture, TeamMemberPictureUploader
end
While looking for similar issues, I came across #267. Maybe my issue is quite similar. But I don't get your answer:
If you need your app to have both old and new images, then you'll need your app to be able to add more images rather than having a single updated one, and also make sure every new upload will assign a unique public ID to every upload.
On the other hand, if you're ok with your app having only a single (latest) version of the image, but still want to not delete the old versions on your Cloudinary account, then you'll need to also make sure the public IDs are unique for each new upload.
What I want is to have one id associated to my record / environment / attribute. But I don't want it to change. The expected behavior is that the new picture will replace the old one.
- 主要語言
- Ruby
- 星號
- 420
- 分支
- 282
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
cloudinary/cloudinary_gem 的其他 Issue
-
難度 4/5 3-5 天 新手友好度 55/100
cloudinary/cloudinary_gem#597 · 1 則留言 ·
-
難度 2/5 1-3 小時 新手友好度 52/100
cloudinary/cloudinary_gem#591 · 3 則留言 ·
-
難度 3/5 1-2 天 新手友好度 45/100
cloudinary/cloudinary_gem#582 · 1 則留言 ·
-
404's when fetching .eml files (from Action Mailbox)可能重新可做 @rnamba-cloudinary 於 400 天前認領,目前沒有進行中的 PR。 未關閉
難度 4/5 3-5 天 新手友好度 30/100
cloudinary/cloudinary_gem#581 · 1 則留言 ·
-
BlobKey, MirrorService and Sidekiq 8 are incompatible可能重新可做 @const-cloudinary 於 541 天前認領,目前沒有進行中的 PR。 未關閉
cloudinary/cloudinary_gem#573 · 3 則留言 · 已指派 1 人 ·
查看 cloudinary/cloudinary_gem 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 65/100
維護者通常 1 天內回覆
-
area: ci benchmark build developer-experience difficulty: easy dx enhancement github-actions good first issue hacktoberfest help wanted performance quality rank: 8 kyu ruby tech: ruby
難度 1/5 1 小時以內 新手友好度 82/100
flisk-sh/flisk-labs#22 ·
-
1.severity: security
難度 2/5 1-3 小時 新手友好度 62/100
維護者通常 1 天內回覆
-
15-minutes 5-minutes algorithm any-language beginner-friendly c cpp csharp easy go good first issue hacktoberfest help wanted java javascript kotlin python rust swift typescript
難度 1/5 1 小時以內 新手友好度 68/100
Huerte/algo-solutions-python#260 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆