Jump to content

Import images by script


---
 Share

Recommended Posts

Hello GOM Team,

 

we have more and more the case where we need to import images coming from others software and fill them into our GOM Inspect reports.

The idea, basically would be to iterate on a folder containing image files and for each file create a report page containing this image + the title of the report contains the name of the image or something in this direction.

The python code to achieve this is clear to me, the only missing step is how to point a specific image to be imported?

If I remember well, this was not possible in the past. Is it now?

If not, we could imagine to generate the binary sequence of the image by ourself, to integrate it in the script (but we would need a clue on how the image are encoded on your side).

 

I hope we can find a soultion, this would save a bunch of extra-clicks on our side!

 

BR

Benjamin

 

 

 

Link to comment
Share on other sites

In the command

gom.script.report.create_image

you can replace the parameter

image=gom.Binary ('SomeBase64BinaryImageData')

with

image=gom.File (r'path\to\your\imagefile')

I guess, that's what you need and it worked at my side at least with *.png-files.

Link to comment
Share on other sites

Hello Theodor,

 

thanks for the quick reply.

 

Just tested : it works like a charm (easier than I thought)!

FYI, I tested it with jpg files too.

 

BR

 

Benjamin

Link to comment
Share on other sites

 Share

×
×
  • Create New...