How do I do a lossless jpg crop?

Ask for help and post your question on how to use XnView Classic.

Moderators: XnTriq, helmut, xnview

iycgtptyarvg
Posts: 92
Joined: Wed Jan 24, 2007 3:59 pm
Location: The Netherlands

How do I do a lossless jpg crop?

Post by iycgtptyarvg »

I have been using FastStone viewer for some years now, and that application has a feature whereby you can cut/crop a piece out of your photos and save them. The thing is, it is doing it losslessly, even though it's a jpg. So, I could cut/crop a picture I've taken multiple times without losing any quality.

How can I do this with XnView? I've been searching the forum, but couldn't find any good info on it.
(\__/)
(='.'=) This is Bunny. Copy and paste bunny into
(")_(") your signature to help him gain world domination.
User avatar
xnview
Author of XnView
Posts: 44616
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: How do I do a lossless jpg crop?

Post by xnview »

You have Lossless operations>Crop
Pierre.
iycgtptyarvg
Posts: 92
Joined: Wed Jan 24, 2007 3:59 pm
Location: The Netherlands

Re: How do I do a lossless jpg crop?

Post by iycgtptyarvg »

#OUCH#, I just lost a picture!!! There is no undo, and it immediately overwrites the file on the hard-disk!!! :evil: :x :evil:

Please fix this terrible bug before others also lose their photographs!
I'm using v1.97.8 and can reproduce this bug consistently.

Do you need my ini file to replicate the bug? Let me know.
(\__/)
(='.'=) This is Bunny. Copy and paste bunny into
(")_(") your signature to help him gain world domination.
User avatar
helmut
Posts: 8705
Joined: Sun Oct 12, 2003 6:47 pm
Location: Frankfurt, Germany

Re: How do I do a lossless jpg crop?

Post by helmut »

Behaviour of JPG losssless crop is tricky and data can be lost too easily. In topic Auto-Backup for JPGlossless cropping an improvement has been suggested.
User avatar
JohnFredC
XnThusiast
Posts: 2010
Joined: Wed Mar 17, 2004 8:33 pm
Location: Sarasota Florida

Re: How do I do a lossless jpg crop?

Post by JohnFredC »

Hmmm... sorry to hear that. :(

But, if the crop was saved to a new file, then perhaps it couldn't be a "lossless" transformation (since the file would have to be recompressed upon saving to the new file)?

Certainly lossless rotations do occur "within" the original file... it is logical that so also would the lossless crop occur "within" the original file.

So, make a copy first!
John
User avatar
XnTriq
Moderator & Librarian
Posts: 6377
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: How do I do a lossless jpg crop?

Post by XnTriq »

Did you change the following setting?
  • Tools » Options... » General » File Operations » For lossless operation, make a backup
AFAIK, it's activated by default.
helmut ([url=http://newsgroup.xnview.com/viewtopic.php?p=82322#p82322]Poor Man's Version Control[/url]) wrote:From my point of view the version control should be much less present in dialogs and be more a backup system than a version control. Especially in some situations like lossless crop a backup can be very important and essential to prevent the user from image loss.
<!-- Edit: Too little, too late :P //-->
iycgtptyarvg
Posts: 92
Joined: Wed Jan 24, 2007 3:59 pm
Location: The Netherlands

Re: How do I do a lossless jpg crop?

Post by iycgtptyarvg »

XnTriq wrote:Did you change the following setting?
  • Tools » Options... » General » File Operations » For lossless operation, make a backup
AFAIK, it's activated by default.
I did not know about this setting, and it was off for me :(

But really, why on Earth is there no undo and does it save immediately? This is horrible behaviour that is going to bring grown men to tears. Luckily I still had a backup on my camera, or I would have lost a couple of my irreplaceable photos.

Please, please, pretty please with sugar on top FIX THIS!!!
(\__/)
(='.'=) This is Bunny. Copy and paste bunny into
(")_(") your signature to help him gain world domination.
User avatar
xnview
Author of XnView
Posts: 44616
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: How do I do a lossless jpg crop?

Post by xnview »

iycgtptyarvg wrote:I did not know about this setting, and it was off for me :(
:( yes not by default... But you have a message that lossless operations works on original file!
Pierre.
iycgtptyarvg
Posts: 92
Joined: Wed Jan 24, 2007 3:59 pm
Location: The Netherlands

Re: How do I do a lossless jpg crop?

Post by iycgtptyarvg »

But WHY do it like this? Who could possibly benefit from the risk of losing your photo?
Is there any logical reason why you can't UNDO/REDO the operation like everything else in XnView?
(\__/)
(='.'=) This is Bunny. Copy and paste bunny into
(")_(") your signature to help him gain world domination.
igel
Posts: 19
Joined: Sat Jul 02, 2016 10:13 am

Re: How do I do a lossless jpg crop?

Post by igel »

Ressurecting an old thread. :)
I'm a long-time user of XnViewMP which is my default image viewer. However for processing images I'm using mostly GIMP.
Long story cut short - I'd like to make a lossless crop of a JPG with XnView.
Under Tools: JPEG lossless operations there are only options for "Rotate" and "Flip". The option "Crop" is grayed out.
It's grayed out in both XnViewMP and the latest XnView I did download today for testing.
Thanks in advance for any suggestion.
User avatar
XnTriq
Moderator & Librarian
Posts: 6377
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: How do I do a lossless jpg crop?

Post by XnTriq »

igel wrote: Sat Jan 21, 2023 6:21 pmUnder Tools: JPEG lossless operations there are only options for "Rotate" and "Flip". The option "Crop" is grayed out.
Does one of the following solutions work for you, igel?
helmut wrote: Tue Aug 30, 2022 7:39 pmFor JPEG lossless cropping please make a selection first. Then, "Tools > JPG Lossless operations > Crop" will be available.
bitz4 wrote: Thu May 23, 2013 10:01 amI open a picture in view, make a selection, on the toolbar I have the 'JPEG lossless transformations' drop-down menu present I click the arrow, and the crop option is the only one greyed out. I have to keep the selection (otherwise it won't work), zoom in or out, then access the menu and only then the crop option becomes available.
igel
Posts: 19
Joined: Sat Jul 02, 2016 10:13 am

Re: How do I do a lossless jpg crop?

Post by igel »

Many thanks!

I should learn to use the software before asking for help. :)
I didn't make the selection first. With the selection done the option isn't grayed out and lossless croping works fine.
User avatar
XnTriq
Moderator & Librarian
Posts: 6377
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: How do I do a lossless jpg crop?

Post by XnTriq »

igel wrote: Sat Jan 21, 2023 8:01 pmI didn't make the selection first. With the selection done the option isn't grayed out and lossless croping works fine.
Thanks for reporting back, igel :-)