@jackie_w, @kovidgoyal,
Am I missing something? Surely the run_calibre_debug process, which is executing code imported from the calibre plugin itself, likewise has access to all plugin resources, and especially the ability to access plugin utilities that extract an image file from the plugin.
The only thing the subprocess *won't* have is the ability to share internal state and memory, and thus, the ability to have a writable handle on the metadata.db.
It should be literally the same as running the plugin normally, but launched from a custom QApplication rather than calibre's.
In general, I don't think there is a reason that calibre-debug --run-plugin should be unable to import all Calibre code, consult the constant variable which says "here is where the user config dir is", or execute the same functions that are available to the GUI.
|