export imagedata into a file ?

jbv jbv at souslelogo.com
Tue May 8 10:17:23 EDT 2018

Hi list,
I have a script that starts as follows :

   put URL "binfile:/myFile.jpg" into tImageData
   put tImageData into image "Image_test"
   put the imagedata of image "Image_test" into tImageData
   -- tImageData processing

After tImageData is processed, I would like to export
its content directly into a file.
I tried :
   put tImageData into URL "binfile:/test.jpg"
but the file is considered corrupted and can't be opened.

I also tried :
   put tImageData into URL "binfile:/test.jpg" as JPEG
but it returns an error.

I know I can set the imagedata of an image to the content
of tImageData, and then use "export snapshot", but for some
reasons too long to explain, I would like to follow a different
So, How can I export the binary content of tImageData to
a jpeg or png file that can be opened like any similar
file ?

Thanks in advance,

More information about the use-livecode mailing list