Batch Convert HEIC to JPG in Linux

You may also like...

9 Responses

  1. David says:

    When I run “sudo apt-get install libheif-examples” I get the following output…

    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    E: Unable to locate package libheif-examples

    Any idea of why or a work around? Thanks!

  2. redoudou says:

    Thank you very much work like magic !

  3. Ivan says:

    sudo add-apt-repository ppa:strukturag/libheif
    sudo apt-get update

  4. Jojo says:

    when i try to do output to .jpeg it throws error unknow file type 13, is it only support jpg output?

  5. Milan Karunarathne says:

    Thanks very much … !!!

  6. LT says:

    This was really good – exactly what I was looking for so thanks for that!

    if you don’t want the output file to have the .heic.jpg file extension after conversion you can use the following to strip it off and replace it with .jpg

    img=$(echo $f | sed “s/\.heif$/\.jpg/”); heif-convert $f $img

    if you wanted to do it all with a one-liner you can use: find . -name “*.heif” -exec bash -c ‘img=$(echo $1 | sed “s/\.heif$/\.jpg/”); heif-convert $1 $img’ _ {} 2>&1 \;

    basically here the results of the find command are passed in as arguments to the bash script. the _ is the $0 arg and the {} is the filename which ends up as $1 within the bash command.

  7. Francis says:

    it start to convert but every file has that note:

    “Not a *.jpg / *.png / *.mp4 / *.avi! IMG_0001.HEIC”

    …in the folder, the files are also .HEIC-format… did i missed something? Thanks for help!

  1. January 16, 2020

    […] Source: Stuff Jason Does […]

Leave a Reply

%d bloggers like this: