Part Images with REST

So I’ve been messing around with REST with Part Images and while I’ve been able and understand the image data that needs to be rendered is in the ImageContent field (per posts here and experimenting), I can’t help but notice some of the values returned by the Erp.BO.ImageSvc/Image() call, such as ImageFileName and ImageFileThumbnail. Along with the image dimensions and type, I can’t help but think there must be an easier way to access these images directly for use in rendering on a webpage or something. Like why is there ImageFileName and ImageFileThumbnail if you can’t point an image control source at it… like [AppServer/instance/api/[company]/images/[ImageFileThumbnail] or something?

Not really an answer to your direct question, but have you looked at this?

https://www.epiusers.help/t/images-from-alternate-storage-instead-of-db-blobs/107003

1 Like

This is one of the reasons we’re looking to move images out of the database and use something like ECM or SharePoint. It has the extra benefits of making the images available for other custom apps and reducing the memory load on the SQL server. If you’re a cloud user, that makes you less of a noisy neighbor.

In the meantime, one could write a web app that does exactly what you are asking to do. Pass an ID of some kind and have the web app call a function that does all the work converting it to an image and returning the image wherever you want.

*** And reading Evan’s post, this is exactly what Kevin did.

Hey @Rick_Bird , are you just asking general questions or did you have something specific in mind?

This was just a general question making sure I’m not missing something obvious. But it looks like you have to call a service that would return the imagecontent no matter what. I just didn’t understand the purpose of the ‘ImageFile’ and ‘ImageFileThumbnail’ fields. Just curious why they are there.
Regardless, @klincecum is very interesting.
I did find out that some platforms, such as PowerApps can have an image source defined as a function that can point to a base64 string that ImageContent provides…

Yeah if you are wanting to pull these straight from the web, best to have an intermediary of some sort, like a web server with node or php to pull and send it.

1 Like

How To Embed Images Directly Into Your HTML | Techerator
Could it be this simple?