After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 339081 - lossless JPEG-cropping
lossless JPEG-cropping
Status: RESOLVED WONTFIX
Product: f-spot
Classification: Other
Component: Editing
0.1.x
Other All
: Normal enhancement
: ---
Assigned To: F-spot maintainers
F-spot maintainers
gnome[unmaintained]
Depends on: 338997
Blocks:
 
 
Reported: 2006-04-19 20:34 UTC by Anders Bo Rasmussen
Modified: 2018-07-12 00:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Lossless jpeg cropping (72.52 KB, patch)
2006-05-15 10:29 UTC, Stephane Delcroix
reviewed Details | Review
Lossless jpeg cropping: a minimal UI (1.87 KB, patch)
2006-05-15 10:40 UTC, Stephane Delcroix
reviewed Details | Review

Description Anders Bo Rasmussen 2006-04-19 20:34:54 UTC
The jpeg crop does not seem to be lossless. Lossless cropping of jpegs is
possible to do for JPEGs like it is possible to do 90 degress rotation lossless.


A description of the concept:
http://www.impulseadventure.com/photo/lossless-rotation.html

I used this program before (with wine):
http://ekot.dk/programmer/JPEGCrops/
it is a GUI-frontend to jpegtran:
http://sylvana.net/jpegcrop/

according to bug 338997 (jpegtran performance enhancement) f-spot used
libjpegtran. I don't know if this version of (lib)jpegtran contains the patch
that make lossless cropping possible. It is described at
http://sylvana.net/jpegcrop/. If this is the case it should be easy to implement
lossless cropping.
Comment 1 Stephane Delcroix 2006-04-20 11:02:37 UTC
The jpegtran bundled with f-spot does not contain the croppatch.
Just as you, I think that cropping should be done losslessy.

Having this functionality in f-spot imply patching libjpegtran, creating bindings in libfspot (in C) and writing a new C# binding in JpegUtils.

Before doing it, it require to solve the following issue: libjpegtran is borrowed from gthumb; does libjpegtran in f-spot in sync with the gthumb one ? Or it was only a one-time ? If libjpegtran is still in sync with gthumb, maybe this bug should be in gthumb, which also have a lossy 'crop' functionality.
Comment 2 Larry Ewing 2006-04-20 16:38:32 UTC
It was a one time sync.  I'm not sure what the state of libjpegtran in gthumb is now but there is no problem with a new sync if if offers crop now.
Comment 3 Stephane Delcroix 2006-05-15 10:29:03 UTC
Created attachment 65484 [details] [review]
Lossless jpeg cropping

This patch allow lossless jpeg cropping in f-spot.

It is based mainly on the diff between the jpegtran code already included in f-spot and the official jpegtran code with cropping functions.

This patch contains only the code to do the cropping, not the bindings to the UI.

One minor drawback you need to know if you want to use it: the x and y offsets provided must be aligned to jpeg blocks. It they are'nt, x and y offsets will be  lowered to match a jpeg block. It means that if x or y are not a multiple of 8, they will be changed to the first multiple of 8 backward. 
It's not a bug, it's the only way to make jpeg lossless
Comment 4 Stephane Delcroix 2006-05-15 10:40:46 UTC
Created attachment 65486 [details] [review]
Lossless jpeg cropping: a minimal UI

This is the ui code to show how to use the previous patch.

This patch sucks. The UI is not refreshed after cropping, nor the icon view. But the cropping is made...

F-Spot will crash if you try to crop a rotated image (i.e. an image not oriented in the file as in the thumbnail)

Before doing the complete and working UI code for this, some things need to be discussed:
 * How to rename the cropped version
 * If the user choose an aspect ratio for the cropping, and the x and y offset does not match a jpeg block (i.e. are not multiples of 8), what should we do ?
    - break the constraint and raise the selection to match the blocks ?
    - raise the selection in the top left to match jpeg block, and raise the selection in bottom right to match the constraint ?
 * How to let choose the user if he wants a lossless or a lossy cropping ?
Comment 5 Stephane Delcroix 2006-05-16 09:14:40 UTC
Please mark this as a dependency of #338997
Comment 6 Bengt Thuree 2006-05-16 09:32:48 UTC
As per request in comment #5 I added a dependency to 338997
Comment 7 Larry Ewing 2006-07-20 22:06:00 UTC
Ok this is looking very promissing.  I'd love to get this into the editing code as it gets reworked.  I'll try to write up something of a skeleton design for the new  editing interfaces very soon.
Comment 8 Stephane Delcroix 2006-07-21 07:49:01 UTC
Larry,

why not committing the libjpegdump (attachment #65484 [details]). It's backward compatible with the previous jpegdump code...

It will be easier for other developers to start using it...

my €0.02...
Comment 9 Jean-Philippe Fleury 2009-04-25 23:20:43 UTC
Hi,

I wonder what are news about lossless cropping in F-spot? Is the patch used in F-spot 0.5.0.3 and Gnome 2.26.1?
Comment 10 Valent Turkovic 2009-12-10 13:06:17 UTC
Is this feature implemented in gthumb?
Comment 11 seb 2010-02-23 21:27:15 UTC
hi there,
bump - any news on this one? ...I want to stop using IrfanView to have lossless cropping :-)
Comment 12 André Klapper 2018-07-12 00:09:53 UTC
F-Spot has moved to https://github.com/f-spot/f-spot/issues

If this Bugzilla ticket is still valid in a recent version of F-Spot, please feel free to post this topic as a ticket in the F-Spot project on GitHub.

Closing this report as WONTFIX as part of Bugzilla Housekeeping as we are planning to shut down GNOME Bugzilla in favor of GNOME Gitlab.