this post was submitted on 15 Aug 2025
17 points (94.7% liked)

Linux

57320 readers
396 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 6 years ago
MODERATORS
 

imagemagick Montage:

I can only create a montage if all the exif data is cleared.

As a new user on Lemmy, going through the learning curve, I had issues uploading images.

Simple, I turned to imagemagick to reduce the size of the images and create a montage, rather than uploading 20 images for a simple bread recipe.

!bready@lemmy.world

========================================

I transfered my recipe images from my phone to my laptop and set about using Montage.

The images on the phone, and in the directory on my laptop, were clearly orientated in Portrait and not landscape.

========================================

Problem:

I ran montage to create a simple 4 image montage:

montage 1.jpg 2.jpg 3.jpg 4.jpg -geometry +2+2 1-montage-image.jpg

I checked the output file, the images were in the right order but had changed from portrait to Landscape. They looked terrible

I then tried some different images.

These came out as expected, in portrait and in order

=======================================

I compared the images,

identify -verbose 1.jpg

the ones I transfered from my phone still had all the exif data intact and the other ones had no exif data

========================================

So I cleared the exif data for the files.

exiftool worked perfectly:

exiftool -all= *.jpg

created an "original-images" directory, then moved the originals to "original-images" directory

mv *.jpg_original original-images

when I cleared the exif data all the images in the directory reverted to landscape

========================================

so I set them back to portrait:

One liner to change orientation by 90 degrees

find . -maxdepth 1 -type f -name "*.jpg" -exec convert {} -rotate 90 {} ;

or mogrify:

mogrify -rotate -90 *.jpg

or

mogrify -rotate +90 *.jpg

========================================

created the montage image:

montage 1.jpg 2.jpg 3.jpg 4.jpg -geometry +2+2 1-montage.jpg

========================================

Now I reduced the size so I could upload them

create an "images" directory if you do not want mogrify to overwrite the originals.

mogrify -resize 50% -quality 80 -path "/path/to/reduced/images/" *.jpg

or

mogrify -resize 50% -quality 80 -path "images" *.jpg

job done

========================================

A lot of messing about to upload an image

top 3 comments
sorted by: hot top controversial new old
[–] cerement@slrpnk.net 2 points 2 hours ago
  • -auto-orientauto-orient will read from EXIF
  • -stripstrip will remove all metadata
  • WARNING: if you’ve already used -strip, then -auto-orient will do nothing
[–] bjoern_tantau@swg-empire.de 2 points 4 hours ago

In case you (or someone else) wants an explanation.

Modern cameras and phones save the image orientation in the exif data while keeping the orientation of the real pixels like they were originally.

But by default imagemagick doesn't use the exif data but the real pixel orientation. That's why the orientation in the montage and after removing exif data was wrong.

I think there are options to let imagemagick read the exif data. I'm too lazy to look it up.

[–] BCsven@lemmy.ca 1 points 6 hours ago

Two of my favourites, Linux and Bread. We need a Bread centric distro.