caesium-image-compressor icon indicating copy to clipboard operation
caesium-image-compressor copied to clipboard

While resizing images sometimes the dimensions are not set correctly

Open ltvkit opened this issue 9 months ago • 13 comments

This only applies to versions 2+ Version 1.7 works fine, and I'll be using that for now.

Basically once a week I resize all of my new photos, from my camera. They are all JPG's. (around ~500 images) Original size is: 6240px x 4160px

I always used the resize: 50%x50%, and I tried with dimensions: 3120px x 2080px

But maybe ~30% of the photos, get distorted/stretched, usually by only resizing only Width or Height. And all the others are fine... weird bug. :)

ltvkit avatar Mar 21 '25 15:03 ltvkit

I didn't get which is the option that gives you distorted images? Is it when you resize by percentage (es. 50%) or when you resize by width or height?

Lymphatus avatar Mar 21 '25 18:03 Lymphatus

Both. Which is kinda weird. :)

emiliskvg avatar Mar 21 '25 18:03 emiliskvg

It's always the same photos that get stretched or is it random? Does still happen in v2.8.4?

Lymphatus avatar Mar 21 '25 18:03 Lymphatus

  1. Hmm, not quite sure, I'll take a look when I have time.
  2. Yes, still broken with V2.8.4

emiliskvg avatar Mar 21 '25 18:03 emiliskvg

A small update, and maybe you can close this thread. I tested more images today, and figured out that my camera (Canon) adds bad JPEG Rotation and EXIF Orientation data to the image files. So some photos are taken at a vertical orientation or upside-down, and the compression library doesn't understand that, and resizes it wrongly. Seems to only affects Caesium versions 2+ for some reason.

ltvkit avatar Mar 24 '25 07:03 ltvkit

It's a bug, just tested with pictures from my Sony camera. I thought it was fixed since 2.8.3 but seems not the case with the "percentage" and "dimension" options. As a workaround while I fix it, you can use the "Short edge" or "Long edge" options that should keep the rotation correctly (if you also select "Keep Metadata"). Setting "3120px" on the long edge should give you the desired result.

Lymphatus avatar Mar 24 '25 07:03 Lymphatus

Okay, thanks. Sorry about the two account discussion. Work and personal devices. 😅

emiliskvg avatar Mar 24 '25 07:03 emiliskvg

I have the exact same issue, with the "percentage" resize options vertical images from my phone get distorted, all of them, consistently.

t0ma5 avatar May 21 '25 18:05 t0ma5

Same issue, usually use percentage. When using Long/Short edge, it always takes the first or second dimension, regardless of orientation. So it does keep the aspect ratio, but the compression is different depending on orientation of the photo.

edit: i have noticed it only happens with photos from my Fujifilm camera. the Canon pictures are handled as expected.

edit2: as an example, this image is compressed to a horizontal aspect ratio. regardless of whether its compressed with other horizontal pictures or not: https://imgur.com/B3o7H7m

pandabearcodes avatar Jul 17 '25 10:07 pandabearcodes

Same issue, usually use percentage. When using Long/Short edge, it always takes the first or second dimension, regardless of orientation. So it does keep the aspect ratio, but the compression is different depending on orientation of the photo.

edit: i have noticed it only happens with photos from my Fujifilm camera. the Canon pictures are handled as expected.

edit2: as an example, this image is compressed to a horizontal aspect ratio. regardless of whether its compressed with other horizontal pictures or not: https://imgur.com/B3o7H7m

I have the same problem, V2.8.5

lolo968 avatar Jul 17 '25 17:07 lolo968

I think it might be caused by mixed compression of horizontal or vertical photos? Because if the first photo is horizontal, then all photos will get the horizontal ratio.

lolo968 avatar Jul 17 '25 17:07 lolo968

I think it might be caused by mixed compression of horizontal or vertical photos? Because if the first photo is horizontal, then all photos will get the horizontal ratio.

I have the same results, regardless if i process it alone, only with pictures with the same orientation, or with mixed orientations.

pandabearcodes avatar Jul 18 '25 07:07 pandabearcodes

I can confirm this is a bug, I just tested with some of my pictures straight from a Sony camera with metadata for orientation. I'm currently working on v3 and this issue is fixed there. It might take a while to ship since it's not even on alpha now, but I wanna assure I'm aware of the issue and it's gonna be fixed asap.

Lymphatus avatar Jul 19 '25 12:07 Lymphatus