[Gdal-dev] how can i get the error msg

mjollnir mjollnir.ray at gmail.com
Thu Apr 2 11:25:55 EDT 2009


It's ok. thanks form your reply.

can i know the health status of the image file before process it.


mjollnir,

It looks like this warning is issued by libjpeg in the fill_input_buffer
function:

fill_input_buffer (j_decompress_ptr cinfo)
{
   my_src_ptr src = (my_src_ptr) cinfo->src;
   size_t nbytes;

   nbytes = JFREAD(src->infile, src->buffer, INPUT_BUF_SIZE);

   if (nbytes <= 0) {
     if (src->start_of_file)     /* Treat empty input file as fatal error */
       ERREXIT(cinfo, JERR_INPUT_EMPTY);
     WARNMS(cinfo, JWRN_JPEG_EOF);
     /* Insert a fake EOI marker */
     src->buffer[0] = (JOCTET) 0xFF;
     src->buffer[1] = (JOCTET) JPEG_EOI;
     nbytes = 2;
   }

   src->pub.next_input_byte = src->buffer;
   src->pub.bytes_in_buffer = nbytes;
   src->start_of_file = FALSE;

   return TRUE;
}

It appears that while we (GDAL) overrides the error exit
handler for the libjpeg library, we do not override the warning
handler so the warnings are just issued to stdout or stderr.

If you file a ticket on this, I can likely correct the warning
handling.  However, it is unlikely to be treated as a fatal error
since the authors of libjpeg have apparently decided that a
truncated file should not be treated as an error.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

_______________________________________________
gdal-dev mailing list
gdal-dev at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev



-- 
View this message in context: http://n2.nabble.com/how-can-i-get-the-error-msg-tp2575343p2575846.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.



More information about the gdal-dev mailing list