How to convert HEIC photos to something normal?
Table of Contents
Using GIMP
-
Figure out the folders with
HEICfiles. UsePrintDirectoriesWithFilesWithAGivenExtension.java -
Move all the
HEICfiles into a sub-folder calledconvert.-
Use
MoveFilesWithAGivenExtensionIntoASubfolder.java -
DO NOT USE
find <directory> -name '*.HEIC -exec mv '{}' <other_directory> \; find . -name '*.HEIC -exec mv '{}' convert \;
-
-
Doing the conversion from
heictojpgPut the following in
~/.gimp-<YOURVERSION>/scripts/myconvert.scmIn Linux, the folder will be
~/.config/GIMP/2.10/scripts(define (myconvert in_filename out_filename) (let* ( (image (car (gimp-file-load RUN-NONINTERACTIVE in_filename in_filename))) (drawable (car (gimp-image-get-active-layer image))) ) (gimp-file-save RUN-NONINTERACTIVE image drawable out_filename out_filename) (gimp-image-delete image) ) )Then, you can run something like this to convert all the files in the current directory to JPGs:
for A in * ; do gimp -i -b "(myconvert \"$A\" \"$A.jpg\")" -b '(gimp-quit 0)' ; done -
Rename the converted files. Clean up the names.
-
Move all the converted
jpgfiles from theconvertfolder back into the original folder. -
Delete the
convertsubdirectory.
Using imagemagick
(DID NOT WORK)
paru -S imagemagick
Using it
magick IMG_3574.HEIC IMG_3574.jpg
Ran into an error:
magick: error while loading shared libraries: libxml2.so.16: cannot open shared object file: No such file or directory
Using libheif
(DID NOT WORK)
- Find out the list in the current directory
find . -type f -name "*.HEIC" - Install https://github.com/strukturag/libheif
paru -S libheif - Grab the output from the
findcommand and convert it into a command like this. Thequoteswill make sure that the command will work even though there are whitespaces in file or folder names.heif-dec "/home/explorer436/pCloudDrive/FromSync/Receipts/2019-05-26_KitteryTradingPost.HEIC" "/home/explorer436/pCloudDrive/FromSync/Receipts/2019-05-26_KitteryTradingPost".jpg"" heif-dec "/home/explorer436/pCloudDrive/FromSync/Receipts/2019-06-25_Fedex.HEIC" "/home/explorer436/pCloudDrive/FromSync/Receipts/2019-06-25_Fedex.jpg" heif-dec "/home/explorer436/pCloudDrive/FromSync/Receipts/2019-07-05_Kmart.HEIC" "/home/explorer436/pCloudDrive/FromSync/Receipts/2019-07-05_Kmart.jpg"