Page 1 of 1

An "ignore Error Read/Write" parameter for nconvert too

Posted: Fri May 31, 2013 6:44 pm
by oops66
Is it possible to have an "ignore Error Read/Write" option/parameter for nconvert too ?

To be able to convert jpg file, even with error or warning like:

Code: Select all

./b.jpg 2592 x 1944 24bit Exif  Normal Huffman  737606  Premature end of JPEG file  [WARNING]
Because I got this message with nconvert for this kind of corrupted file:

Code: Select all

  Error: Can't read file (b.jpg)
Edit:
I saw one of your posts about this : 21 Sep 2009
"Nconvert has not yet option to handle files with premature end of file"
http://newsgroup.xnview.com/viewtopic.php?f=57&t=18373
still the same answer ?

Re: An "ignore Error Read/Write" parameter for nconvert too

Posted: Mon Jun 03, 2013 8:03 am
by xnview
ok, i'll add this option

Re: An "ignore Error Read/Write" parameter for nconvert too

Posted: Mon Jun 03, 2013 9:52 am
by oops66
xnview wrote:ok, i'll add this option
Thank you Pierre, (I think this parameter should be enabled by default).
FI: because I would like to use a script with nconvert to "correct" (create a new file without error) automatically & recursively my corrupted jpg files containing errors with jpeginfo (generate a txt file list first):

Code: Select all

find . -iname "*.jpg" -print0 | xargs -0 jpeginfo -c -i -v | awk -F\  ' ($0 ~ /ERROR/) || ($0 ~ /WARNING/) {print "nconvert -q 100 -keepfiledate -keepcspace -keep_icc -out jpeg -o " "\"" $1"_jpeginfo-corrected.jpg" "\"" " " "\""$1 "\""}' | tee fic_jpeginfo-errors.txt
The generated text file list:

Code: Select all

nconvert -q 100 -keepfiledate -keepcspace -keep_icc -out jpeg -o "./a.jpg_jpeginfo-corrected.jpg" "./a.jpg"
nconvert -q 100 -keepfiledate -keepcspace -keep_icc -out jpeg -o "./2/b.JPG_jpeginfo-corrected.jpg" "./2/b.JPG"
nconvert -q 100 -keepfiledate -keepcspace -keep_icc -out jpeg -o "./2/3/4/c.JpG_jpeginfo-corrected.jpg" "./2/3/4/c.JpG"
etc ...
Do you have a better way to do that?

Re: An "ignore Error Read/Write" parameter for nconvert too

Posted: Tue Jun 04, 2013 8:07 am
by oops66
...PS: It will be interesting to have this kind of search function for corrupted files into XnView(MP) ;-)
... I tested with: NConvert 6.17 pour Linux (x86) 64bit
Actually I use imageMagic - mogrify to do that and correct the corrupted jpg files (with a copy of the file) but I prefer nconvert :

Code: Select all

#convert it to png
mogrify -format png /a/test.jpg
#and then back to jpg
mogrify -format jpeg /a/test.png