Using mogrify to strip rubbish from image files with loss
Posted: 2014-10-24T03:37:18-07:00
I'm looking to post-process files recovered from corrupt/damaged disks using photorec. One of the problems with its type of recovery is that it can't always detect the end of a file, and so (for example) an 500byte .gif file might be recovered as a 1.5GB file...
If I run:
.. then I get the 500 byte file back.
My question is: What options do I need to give mogrify, in the general case (ideally for all image types that it supports, but certainly common ones like jpg,png,gif) to ensure that all it does is load the file and save an identical copy (other than stripping off the rubbish). I don't want to lose meta data or re-encode/re-compress the image in any way. Indeed, is it sufficient to just not tell it to do anything (as above) to be sure that it does nothing, which would normally be pointless but in this case extremely useful?
If I run:
Code: Select all
mogrify recovered.gif
My question is: What options do I need to give mogrify, in the general case (ideally for all image types that it supports, but certainly common ones like jpg,png,gif) to ensure that all it does is load the file and save an identical copy (other than stripping off the rubbish). I don't want to lose meta data or re-encode/re-compress the image in any way. Indeed, is it sufficient to just not tell it to do anything (as above) to be sure that it does nothing, which would normally be pointless but in this case extremely useful?