Skip to main content

Howdy,

Two questions:

 

1) Is there a method for using a Tester like transformer to identify if a "JPEG datastream" contains an image or not prior to a record reaching the RasterReplacer. Details below.

2) Purely out of curiosity, how would I go about turning off the Translation Log error referenced in the snippet below? (...this warning can be turned as an error by setting GDAL_ERROR_ON_LIBJPEG_WARNING to TRUE)

 

I'm processing images that were taken via Esri's AGOL Collector as attachments to a feature record. In my workflow I'm using RasterReplacer to extract the images from the AGOL data field (arcgisonline_attachment{0}.data (encoded: fme-binary)) and I have come across an issue where some images are corrupted.

When these bad images reach the RasterReplacer it throws a translation error "JPEG reader: libjpeg: JPEG datastream contains no image". Full translation log error message below:

 

2019-05-14 14:05:48|   6.8|  0.0|WARN  |JPEG reader: libjpeg: Premature end of JPEG file (this warning can be turned as an error by setting GDAL_ERROR_ON_LIBJPEG_WARNING to TRUE)

2019-05-14 14:05:48|   6.8|  0.0|ERROR |JPEG reader: libjpeg: JPEG datastream contains no image

2019-05-14 14:05:48|   6.8|  0.0|ERROR |JPEG reader: Failed to open the dataset 'D:\AppData\Local\FME_1557867948437_17548.jpg'. Please ensure source data is valid and correct reader is selected

2019-05-14 14:05:48|   6.8|  0.0|ERROR |A fatal error has occurred. Check the logfile above for details

2019-05-14 14:05:48|   6.8|  0.0|ERROR |@GeometryFormat: Blob attribute cannot be read from file 'D:\AppData\Local\FME_1557867948437_17548.jpg'

2019-05-14 14:05:48|   6.8|  0.0|ERROR |RasterReplacer: A fatal error has occurred. Check the logfile above for details

 

In trouble shooting this issue I've found that these corrupted images typically have a name attribute of "attachment#.jpg" (where good images appear to be named "photo#.jpeg") and I've set a Tester to filter these out and redirect them in my workspace.

However, since I won't have eyes on this process in the future I'd like to be confident that anything which might trigger a "JPEG reader: libjpeg: JPEG datastream contains no image" error in the future will be rerouted when the process is automated.

Thank you for the assistance.

Looking at this issue another way, If someone can help me with "setting GDAL_ERROR_ON_LIBJPEG_WARNING to TRUE" then I could use the GeometryFilter to filter out the non-rasters before I write to the JPEG Writer.

Thanks!


Looking at this issue another way, If someone can help me with "setting GDAL_ERROR_ON_LIBJPEG_WARNING to TRUE" then I could use the GeometryFilter to filter out the non-rasters before I write to the JPEG Writer.

Thanks!

I created a case with Safe Software and they assisted me with this issue, turns out there is a RasterReplacer bug in FME 2018 that is fixed in 2019.1

After installing the newer version of FME the records that were generating the error and terminating the translation are instead output via the Rejected port and I am able to work with them from there.

Thank you Safe for the awesome support!


Reply