I would love to be able to write plugins that can analyze actual image data. For example, an exposure normalization plugin that would adjust exposure based on a common point of reference on the picture would really rock. Anybody have any clue how image data could be extracted from the preview data?
Marten Veldthuis wrote:
Did you find any way?
Not yet. I have a feeling there is a way to decode the previews in Lua, but it may be more trouble than I'm will to go through, given that one could always invoke the preview getting command line app (I forget its name) or just export a tiff or high quality jpeg and then read the image from that in Lua - more klugy and time consuming but may be worth the wait for some things. I'm hoping someone will come along and say that the preview storage is fairly straight forward and it wouldn't be that hard to get at from Lua - preferrably with some source code to reference, or a document... - even just knowing it won't be that hard may be enough for me to look into it myself...
Why don't you do it, for us?
I'd like to be able to use image previews too in my dialogs (maybe to overlay some informations on the image).
I'm guessing right now that one would have to do an export in the background and use the generated images... not very practical...
For now anyway, I suspect rendering an export is the only way a plugin will be sure to get fresh image content, even if it could access the previews, since it can't be sure the preview data is fresh (unless it begs the user to update the previews before running, which is still a possibility). Anyway, one would still need to be able to read the image data from the exported file, and I haven't figured out how to do it yet. So, in lieu of preview reading, if anybody could point me/us to a tiff and/or jpeg reader in lua, or some other source code that could be a starting point - that would be a help.
Europe, Middle East and Africa