Skip to content

Instantly share code, notes, and snippets.

@desjare
Last active December 20, 2022 14:14
Show Gist options
  • Save desjare/ff6749dab4c0b9796c590da3cbc6828b to your computer and use it in GitHub Desktop.
Save desjare/ff6749dab4c0b9796c590da3cbc6828b to your computer and use it in GitHub Desktop.
iPhone or iOS: converting HEIC images files to JPEG on ubuntu

Converting iPhone or iOS HEIC picture files in ubuntu and import them Shotwell

Accessing your pictures on Ubuntu

This is explained here. Basically, in your file browser in your iPhone document folder:

  • Press CTRL+L to get the real address which will look like afc://YOURSERIAL:3/
  • Remove trailing colon and number and press ENTER (i.e. it should just read afc://YOURSERIAL)

Then, in the DCIM folder, all your pictures should be there including your .HEIC files.

Getting tifig

tifig will do the work. It is a command line tool to convert HEIC into JPEG. The easiest way is to use their static build that you can found in their release section here. You can dowload the build, make the binary executable and put it in your path (/usr/local/bin).

Converting your files

An easy way to do that is to write yourself a simple script to do the the work. I wrote a shell script that I called convertheic2jpeg.sh. I put it in my $HOME/bin folder.

It takes a file input argument and output the jpeg in my $HOME/Media/HEIC folder. This is pretty hardcoded but you get the idea.

#!/bin/bash
STRIPEXT=`basename $1 |cut -f1 -d'.'`
OUTPUT=$HOME/Media/HEIC/$STRIPEXT.jpg
tifig -i $1 -o $OUTPUT

Then, you can use find in the terminal from your DCIM folder and use your script to convert all your HEIC files into jpg:

find . -name "*.HEIC" -exec ~/bin/convertheic2jpeg.sh {} \;

Importing in shotwell

Then, in shotwell, you can simply import your HEIC converted jpeg folder and you are done.

@bewies
Copy link

bewies commented Dec 20, 2022

libheif comes with it's own heic to jpeg converter, I just used that. But the rest just works for me. Thank you, my lack of knowledge, how bash works, forced me into searching a solution online. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment