You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to convert heic to jpg using Mini magick, but it seems that process convert: :jpg does not allow to specify quality, so I created a method and tried to convert it using minimagick!.
The file type is converted to jpg, but the filename extension remains heic.
CarrierWave::SanitizedFile(self.file)inconvert_to_jpegchanges both content_type and file extension to jpg, butCarrierWave::Storage:::Fileinfilename Fog::File(self.file)` is heic.
What I found strange is that converting with process convert: :jpg also changes the extension. It's pretty much the same as the convert source, but my method didn't change it. How can I change it?
The text was updated successfully, but these errors were encountered:
gomo
changed the title
The file name extension does not change after changing the file type in minimagick!
The file extension does not change after changing the file type in minimagick!Dec 12, 2023
Solution for Handling HEIC Image Uploads with CarrierWave and MiniMagick
To address issues with displaying HEIC images after upload using CarrierWave, follow these steps to convert HEIC files to JPEG format during the upload process:
Update ImageUploader
Ensure HEIC is included in the list of allowed file extensions:
defextension_white_list%w(jpgjpeggifpngheic)end
Implement Conversion Method
Add the following method to your ImageUploader to convert HEIC images to JPEG:
I want to convert heic to jpg using Mini magick, but it seems that
process convert: :jpg
does not allow to specifyquality
, so I created a method and tried to convert it usingminimagick!
.The file type is converted to jpg, but the filename extension remains heic.
CarrierWave::SanitizedFile(self.file)
in
convert_to_jpegchanges both content_type and file extension to jpg, but
CarrierWave::Storage:::Filein
filename Fog::File(self.file)` is heic.What I found strange is that converting with
process convert: :jpg
also changes the extension. It's pretty much the same as theconvert
source, but my method didn't change it. How can I change it?carrierwave/lib/carrierwave/processing/mini_magick.rb
Lines 101 to 107 in 20c6d75
The text was updated successfully, but these errors were encountered: