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

Adding Repositories in Centos 5.3

yum install yum-priorities vim /etc/yum/pluginconf.d/priorities.conf ---- [main] enabled=1 ----   Install RPMForge: cd /home wget…

Ubuntu 19.04: How to Install Adobe Acrobat Reader

Back  in the days when Adobe Acrobat Reader for Linux was supported and available on…

How To Run Python Interactive Command Line Mode (CLI)

Windows PS C:\WINDOWS\system32> python Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:37:50) [MSC v.1916 64 bit…