Inky Frame 7.3" - Photos keep loading rotated and cut off; driving me bananas

I’ve had the Inky Frame since around Black Friday last year and love it. Without much trouble at all, I loaded some photos onto it and it worked flawlessly. I didn’t bother rotating the photos but have now decided to sit down and try that using ImageMagick on Linux. Anyway, script made and working great, and my portrait photos were rotated with padding / background to fit nice and centered on landscape, or so I hoped.
The rotten thing just refuses to orient the picture and instead cuts off about 30% of it, at the wrong angle, over on one side of the display. I’ve tried so many size / ratio combinations that I’ve given up. I tried 800x480 and loads of variations below that but it just keeps behaving the same way.

I looked at the JPEGDEC library which seems to have an auto rotate enumeration on the decode method, but that doesn’t seem to do anything.
Has anyone else experienced this? I don’t know what else to try… Things seem to have been fine before but, even though I’m fitting it within the dimensions of the display, it’s not having any of it.

I’ve not had any problems displaying images rotated with GIMP - I wonder if ImageMagick is doing something weird here? Can you post a link to one of the processed files?

1 Like

Maybe post the script you are using to rotate the images.
Can you also say what you are using to display the images? Is it just the Python Inky library?

1 Like

I’m very sorry for the slow reply… Had a bit of a manic week and should have waited until that was over before writing the post.

This was a problem caused by me and, in light of that, quite nice to see that the Inky Frame handles these kinds of things in some fashion (at least displaying something rather than nothing at all).
I made an assumption that I could take a portrait photo, let’s say 480x800 for argument’s sake, then shrink the height down to 480 (with the width scaling down relatively), then overlaying that on a 800x480 photo to make something landscape. That sort of worked but, no doubt due to my lack of photo editing / formatting knowledge, the Inky Frame still wanted it rotated so seem to have some concept that the original photo was portrait (maybe ImageMagick not changing certain photo properties).

Anyway, all I did was add a rotation command to the mix (when the input image is detected as portrait). Here is my not-so-glamorous attempt of doing this in bash… I bet it could be made a lot cleaner and more efficient, but it works for me in the meantime. Note that I’ve saturated the photo colours in the script so they come out a little more true on the Inky Frame.

#!/bin/bash

cd "$(dirname "$0")"

OUTPUTDIR="./output_$(date +%Y%m%d_%H%M%S)"
mkdir ${OUTPUTDIR}

list=$(ls ./*.jpg)

for j in $list; do
	#-auto-orient needed because it sorts width and height by largest to smallest which is massively unhelpful
	inname=$(convert -ping $j -format "%t" info:)
	width=$(identify -auto-orient -format "%w" "$j")
	height=$(identify -auto-orient -format "%h" "$j")

	if ((width > height)); then
		convert -resize x800 "$j" -gravity center -crop 800x480+0+0 -scale 10% -blur 0x2.5 -scale 1000% -brightness-contrast -25,0 ${OUTPUTDIR}/${inname}_ul.jpg
		convert -resize 800x -resize 800x480 "$j" ${OUTPUTDIR}/${inname}.jpg
		convert ${OUTPUTDIR}/${inname}_ul.jpg ${OUTPUTDIR}/${inname}.jpg -gravity center -composite -extent 800x480 -modulate 100,140 -brightness-contrast 0x45 ${OUTPUTDIR}/${inname}.jpg
	else
		convert -resize x800 "$j" -gravity center -crop 480x800+0+0 -scale 10% -blur 0x2.5 -scale 1000% -brightness-contrast -25,0 ${OUTPUTDIR}/${inname}_ul.jpg
		convert -resize 480x "$j" ${OUTPUTDIR}/${inname}.jpg
		convert ${OUTPUTDIR}/${inname}_ul.jpg ${OUTPUTDIR}/${inname}.jpg -gravity center -composite -extent 480x800 -rotate 90 -modulate 100,140 -brightness-contrast 0x45 ${OUTPUTDIR}/${inname}.jpg
	fi
done

rm ${OUTPUTDIR}/*_ul.jpg

Thank you for suggesting that it’s something to do with rotation… Hopefully this script can be useful for someone as well.

2 Likes

Awesome, glad to hear that you got it sorted.

I wonder if it was the metadata on the photos that was still recording the original orientation?

I have a feeling it must be that. I’ll have to see if I can edit the metadata to save me tipping my head when checking them on the computer.