Skip to main content
Solved

Raster Image // AttributeFileReader to Image

  • November 1, 2018
  • 4 replies
  • 219 views

rob_z
Forum|alt.badge.img

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

Best answer by rob_z

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

 

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

4 replies

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • November 1, 2018

@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?


mark2atsafe
Safer
Forum|alt.badge.img+59
  • Safer
  • November 1, 2018

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.


rob_z
Forum|alt.badge.img
  • Author
  • Best Answer
  • November 2, 2018

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

 


rob_z
Forum|alt.badge.img
  • Author
  • November 2, 2018

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 :-(