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

Discussions on NConvert - the command line tool for image conversion and manipulation

Moderators: XnTriq, helmut, xnview

Post Reply
User avatar
oops66
XnThusiast
Posts: 2005
Joined: Tue Jul 17, 2007 1:17 am
Location: France

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

Post 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 ?
XnViewMP Linux X64 - Debian - X64
User avatar
xnview
Author of XnView
Posts: 43444
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

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

Post by xnview »

ok, i'll add this option
Pierre.
User avatar
oops66
XnThusiast
Posts: 2005
Joined: Tue Jul 17, 2007 1:17 am
Location: France

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

Post 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?
XnViewMP Linux X64 - Debian - X64
User avatar
oops66
XnThusiast
Posts: 2005
Joined: Tue Jul 17, 2007 1:17 am
Location: France

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

Post 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
XnViewMP Linux X64 - Debian - X64
Post Reply