Peters Flexible RenAmiNg Kit (PFrank) Forum Index Peters Flexible RenAmiNg Kit (PFrank)
Support and Discussion Site for the PFrank File/Folder Renaming Tool (http://www3.telus.net/pfrank)
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

image raw data plugin...

 
Post new topic   Reply to topic    Peters Flexible RenAmiNg Kit (PFrank) Forum Index -> General Support
View previous topic :: View next topic  
Author Message
Tillomar



Joined: 18 Oct 2010
Posts: 5

PostPosted: Mon Jan 10, 2011 3:27 am    Post subject: image raw data plugin... Reply with quote

Hi again,

I tried to use the plugin for inserting date and time from raw images which is supplied with PFrank. It uses the exiv2 cmd line tool, so I installed that, too. The version I got is 0.21 which has changed it's output; the result's line holding the date / time of the image has moved down two rows, so I got the content from the wrong row. Peter, you may want to fix this for later versions of PFrank; it will break the plugin for all users of older exiv2 versions, though, if you don't add a version check to the plugin's init code.

Anyway, I tried to fix this myself in the source code of the plugin (the .py file that I copied from the .py.template file), but as it resides within the program folder (c:\program files (x86)\PFrank\), I need admin rights to write. But even then my changes didn't show up in PFrank; only after I copied my file manually into the virtualized program folder (working under Win7/x64) I got the expected results.

Is there a working, hassle-free standard way to edit the py files on win7?
(yes, this is not really a PFrank topic.)

Another problem, same location: As the code to extract the raw file's time / date information works again, I would like to extract arbitrary information, selected by a RE. (I would try a combination of "Insert File Content from matched Regex" and "Insert MetaData From Raw Image"...) Those informations are not currently supported nativly by PFrank (say: maker notes).

But I'm not familiar with Python -- so maybe someone has already done such a thing!??

Is it possible to send parameters (a RE string) to a plugin? The "Insert File Content from matched Regex" uses a fixed RE in the code... I would rather issue the RE at runtime, but I see no syntax for parameters in plugin calls.
_________________
So long,
Tillomar
Back to top
View user's profile Send private message
Tillomar



Joined: 18 Oct 2010
Posts: 5

PostPosted: Mon Jan 10, 2011 11:29 pm    Post subject: Re: image raw data plugin... Reply with quote

Me again, trying to do it myself...

Quote:
I would like to extract arbitrary information


The code from the plugin source used for calling exiv2.exe:

Code:
inhandle, outhandle, errhandle = os.popen3(' \""%s" "%s"\"  '%(exivpath, fullPathForFile ))


I understand that this issues a command line to the shell which has the form
Code:
fullpath\exiv2.exe fullpath\filename.ext


I tried to modify this to
Code:
fullpath\exiv2.exe -g ShutterCount fullpath\filename.ext

using different methods (inserting text directly into the formatting string, adding a third parameter mask inbetween, and more) without success (scan hangs), and I also don't know how to get debug output from PFrank / Python.

Can anyone tell me how to modify the os.popen3 call for the desired command line?

Tnx,
Tillomar
_________________
So long,
Tillomar
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 09 Mar 2007
Posts: 446
Location: Canada

PostPosted: Tue Jan 11, 2011 6:10 am    Post subject: Reply with quote

Hi,

1)
I also had trouble adding options into the command parameter of popen3.

I didn't download the latest version of exiv2 but with the 0.18 version I issued the following command with options:

inhandle, outhandle, errhandle = os.popen3(' \""%s" "%s" -c xyz\" '%(exivpath, fullPathForFile ))

If I put the '-c xyz' part anywhere else, I got errors about file not found.
Please try:

inhandle, outhandle, errhandle = os.popen3(' \""%s" "%s" -g ShutterCount\" '%(exivpath, fullPathForFile ))

i.e. put the '-g ShutterCount' after the filename path.

2)
For debug information, I run the plugin file in isolation. WHen you install python, you should be able to open files using the IDLE tool. Copy the PFrank plugin file to the install folder for Pfrank and open the file using IDLE. THe IDLE tool has a run command (F5). Just run the file and you should see output in the IDLE command window. You can add print statements to see what is happening. Once the file is completely debugged, it should run fine as a PFrank plugin.

3)
Sorry there is no way to pass a parameter in to the plugin. You will have to make a different pluginn for each regex.
I do this on my XP system. The steps might be different on Windows 7.

Peter.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Peters Flexible RenAmiNg Kit (PFrank) Forum Index -> General Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group. Hosted by phpBB.BizHat.com


Start Your Own Video Sharing Site

Free Web Hosting | Free Forum Hosting | FlashWebHost.com | Image Hosting | Photo Gallery | FreeMarriage.com

Powered by PhpBBweb.com, setup your forum now!
For Support, visit Forums.BizHat.com