Skip to main content

Hi,

 

I read images from a directory and save them in SQL Server as <image>.

I use the AttributeFileReader to create a binary representation of the image which then just gets written into the database (works fine).

I also need to create a thumbnail for each image and save it as blob as well. And here my problem starts - I don't know which transformers I need to use:

My process looks like that:

AttributeFileReader

-->RasterReplacer (I need to create an image)

-->RasterResampler (I create a thumbnail)

-->RasterExtractor (I create binary representation of the image)

the result gets written as <image> into a SQL DB table.

But when I extract the image from SQL Server (with an different application than FME) the thumbnail is no valid image file (whereas the main image is).

For simplicity I uses JPG files only right now.

Any idea what might be wrong with my choice of transformers or their order?

 

Many thanks, Rob

@rob_z

 

Transformer set seem ok.

I suspect writing to the database may be at fault. Is column a "long raw" or what format is it you write to?


One test might be to use an AttributeFileWriter to write the data to a file, instead of writing it to a SQL database. Then you could examine the file to see if it is a valid raster.

If the file is a valid raster, then it's likely the database writing that's the problem. If the file is not valid, then I think the RasterExtractor is probably at fault.


Hi @Mark2AtSafe, @gio

 

the cause of the problem was that I missed the "Target File Encoding" of the AttributeFileWriter - which was set to "System" by default.

Thank you for your help!

Rob

 


Hi @Mark2AtSafe, @gio

 

the cause of the problem was that I missed the "Target File Encoding" of the AttributeFileWriter - which was set to "System" by default.

Thank you for your help!

Rob

 

Sorry - that explanation is a bit confusing as I only used the AttributeFileWriter for testing. And I made that specific mistake with Encoding option. But while doing the testing I also noticed the real cause of why the data was not saved correctly in the database - I just confused the attribute names :-(


Reply