Posted On May 1, 2024

Linux: How to Convert HEIC to JPEG

kimconnect 0 comments
blog.KimConnect.com >> Linux >> Linux: How to Convert HEIC to JPEG

First, install certain utilities:

sudo apt-get install libheif-examples

Second, navigate to a directory where there are HEIC files:

directory="/media/kim/Data/Photos/"
cd "$directory"

Third, run the conversion loop:

# This is a for loop that takes into account multiple variables since file name extensions can vary in type casing
for file in {*.heic,*.HEIC}; do heif-convert $file ${file/%.*/.jpg}; done

Sample output:

$ for file in *.HEIC; do heif-convert $file ${file/%.HEIC/.jpg}; done
File contains 1 images
Written to IMG_2172.jpg
File contains 1 images
Written to IMG_2173.jpg
File contains 1 images
Written to IMG_2198.jpg
File contains 1 images
Written to IMG_2201.jpg
File contains 1 images
Written to IMG_2202.jpg
File contains 1 images
Written to IMG_2203.jpg
File contains 1 images
Written to IMG_2204.jpg

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

Linux: Testing Disk Speed

Below is an exercise in comparing 2 different media: external USB drive vs a SD…

NextCloud Container PHP Memory Issue as Deployed via Kubernetes

Most common example:Below is a raw text paste of an exercise in resolving the issue…

Linux: ‘Initramfs Unpacking Failed’ Error Upon Booting

Error: initramfs unpacking failed: Decoding failed Resolution: sudo sed -i 's/COMPRESS=lz4/COMPRESS=gzip/g' /etc/initramfs-tools/initramfs.confsudo update-initramfs -u# reboot…