Question

Data Streaming - JPG's with custom EXIF tags.

  • 19 December 2022
  • 1 reply
  • 18 views

Badge +3

Hello, I have an FME Server Workspace that uses a Python Caller to write custom EXIF tags to a JPG.

 

I want these images to be provided directly to the user via data streaming. The only way I have found to accomplish this so far is to pass the image path to a filecopy writer. This works OK - It will display the image, and if saved - it will retain the custom EXIF tags - however, when saving the image - it wants to save it as the .fmw workbench name (and .fmw as the filetype).

 

Does anyone have any suggestions to get around this? It seems that the mime-type isn't coming across using the data streaming.

 

FYI - I have tried a JPG writer at the end (feature reader - feature writer), but this cuts out the custom EXIF tags.


1 reply

Userlevel 2
Badge +17

Hi @vhruska​,

The Text File writer can be forced into writing a binary file with a bit of User Parameter coercion. Please try the following:

  • Use an AttributeFileReader to read the JPG file into an attribute named text_line_data
  • Send the feature to a Text File writer
  • In the Workspace Parameters, create a new unpublished text User Parameter named Encoding. Set its default to fme-binary
  • In the Text File writer parameters, link Character Encoding to the Encoding parameter. This will force the Text File writer to write a binary file rather than a text file.
  • Set the MIME type of the Text File writer to image/jpeg

 

Reply