I found it surprisingly tricky to securely send an image to OpenAI for analysis, especially if you don’t want the image to be public or saved in your app’s file storage at all.
Difficulties began with the built-in Picture Uploader, Make Private and base64.
However, after some experimenting, I came up with a solution using the Better Uploader plugin. It lets you access the base64 version of an image without needing to store the file, which makes it perfect for sending securely to OpenAI.
Hope this helps someone else trying to do the same! Happy to answer any questions.
2 Likes
Have you run into any issues with the size of the base64 encoded value? I was playing around with this a couple of weeks ago, and came across an issue with a larger image that the base64 encoded value had millions of characters and froze the app.
I do not know much about base64 encoded values so I didn’t attempt to investigate it further.
Do you know if the plugin is reducing the size of the image prior to creating the base64 encoded value so that it is not as long? When I ask ChatGPT about the length of base64 encoded values, specifically for images, it tells me the below.
Was it freezing in Workflow or just in the API Connector? I’ve found before I have to pick a small file to initialize but after that in workflow I haven’t had issues.
Just don’t store base64 in database
3 Likes
I wasn’t attempting to store it in DB, there is no reason for that.
I think it was freezing in initialization. I’ll have to give it another shot, but I’m working on auto resizing, then conversion to webp and then compression so as to ensure smaller base64 payloads without losing clarity for AI to view image properly.
I started playing around with base64 payloads to AI for giving data from page to a chatbot and the idea of using the base64 rather than actual file is great, and to get the image sent without needing to upload to file manager is awesome as it will give more control over whether or not to actually upload to file manager based on AI analysis.
1 Like