Bug 429853 - Aspect Ratio One Pixel Error
Summary: Aspect Ratio One Pixel Error
Status: RESOLVED NOT A BUG
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-Editor-Crop (show other bugs)
Version: 7.1.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-30 14:20 UTC by Manfred Rebentisch
Modified: 2023-04-30 03:05 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 8.1.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Manfred Rebentisch 2020-11-30 14:20:27 UTC
SUMMARY
If I set to 5:4 ratio and draw the rectangle on the image, the result is
not exact.
Have an image with 3878x3102 and crop 5:4 to 3846x3077 it is 1 Pixel
wrong. If I export the image to a width of 800, then the height is 639,
not 640.

STEPS TO REPRODUCE
1. Take an image
2. Make an crop (i.e 5:4)
3. Look at the size result. If the short side is not dividable with 4, the result is wrong.

OBSERVED RESULT


EXPECTED RESULT


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Maik Qualmann 2020-11-30 15:42:09 UTC
The problem cannot be solved, there is always a 1 pixel error. Calculator itself, the desired aspect ratio is 1.25.

Original image:
3878/3102 = 1.25016

digikam cut:
3846/3077 = 1.24991 deviation: 0.00009

1st attempt:
3846/3076 = 1.25032 deviation: 0.00032

Second attempt:
3846/3078 = 1.24951 deviation: 0.00049

As you can see, the digiKam result has the smallest deviation from the average of 5:4. By the way, if you scale the image with digiKam, the result is 800x600.

Maik
Comment 2 Maik Qualmann 2020-11-30 18:52:55 UTC
I can understand that you would like to see the usual page division factor of 4 for digital photos. But is that really the standard for cutting? A test with Gimp shows the same result as digiKam.

Maik
Comment 3 Maik Qualmann 2020-11-30 19:15:56 UTC
Darktable cuts 5:4 just like digiKam (3846x3077).

Maik
Comment 4 caulier.gilles 2020-12-01 09:55:51 UTC
I tested also the crop feature with the ratio 5:4, and the result given corresponding to Maik results.

The results is also the same with Windows application as Paint.net or Xnview.

Gilles
Comment 5 Manfred Rebentisch 2020-12-01 10:02:18 UTC
If I export the picture to local storage, I can choose the width of the image. Set this to 800px and start export, then the image becomes 800x639.
Comment 6 Maik Qualmann 2020-12-01 10:41:12 UTC
As I said with the scaling tool in the editor, the result would be 800x600. We may be able to round better in the local export tool. But the possibility of 800x639 or 800x641 coming out can always exist.

Maik
Comment 7 Maik Qualmann 2020-12-01 12:25:36 UTC
I cannot reproduce the problem with the local file export tool either. The image size 3846x3077 is exported as 800x600 if an edge length of 800 is set. Even a test with the BQM shows no problem.

Or are you talking about a plugin to upload to a web service?

Maik
Comment 8 caulier.gilles 2023-04-30 03:05:50 UTC
Following comments from Maik, i close this file as not a bug.