Updating an image end up deleting it
@d-mendoza arbeitet bereits daran.
Seit 08.2.2019.
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
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.
- Vorherrschende Sprache
- Ruby
- Sterne
- 420
- Forks
- 282
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus cloudinary/cloudinary_gem
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 55/100
cloudinary/cloudinary_gem#597 · 1 Kommentar ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 52/100
cloudinary/cloudinary_gem#591 · 3 Kommentare ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 45/100
cloudinary/cloudinary_gem#582 · 1 Kommentar ·
-
404's when fetching .eml files (from Action Mailbox)Evtl. wieder frei @rnamba-cloudinary hat das vor 400 Tagen übernommen, und es ist kein Pull Request offen. Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 30/100
cloudinary/cloudinary_gem#581 · 1 Kommentar ·
-
BlobKey, MirrorService and Sidekiq 8 are incompatibleEvtl. wieder frei @const-cloudinary hat das vor 541 Tagen übernommen, und es ist kein Pull Request offen. Offen
cloudinary/cloudinary_gem#573 · 3 Kommentare · 1 zugewiesene Person ·
Alle Issues in cloudinary/cloudinary_gem
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
metacall/core#964 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
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
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 82/100
flisk-sh/flisk-labs#22 ·
-
1.severity: security
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
Maintainer antworten meist innerhalb von 1 Tag
-
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
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 68/100
Huerte/algo-solutions-python#260 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag