Hello,
I started to develop an EXIF module for Drupal 6. This module would come woth Image module.
From now, my module only displays a "Show EXIF" button on each image node, and clicking on this button makes an AJAX call to display EXIF data (at the moment, it is only a raw array data).
I am planning to add a configuration page, where administrator can choose which EXIF data to display.
Reading IPTC data can eventually be done.
I use PHP's EXIF extension, so you only need to activate it in php.ini (no need for PEL).
To EXIF maintainer: please tell me if you are working on a Drupal 6 port, and if my work interests you.
You can get an alpha version of my work in attachment.
Any thoughts or questions are welcome. :)
Regards,
David
Comment | File | Size | Author |
---|---|---|---|
#53 | exif_53.patch | 601 bytes | chachasikes |
#28 | exif_d6.patch | 6.41 KB | aries |
#27 | exif_5to6.patch | 6.8 KB | David Lesieur |
#17 | exif.zip | 617.41 KB | macsim-1 |
#8 | exif_ajaxcall.patch | 6.19 KB | David Stosik |
Comments
Comment #1
David Stosik CreditAttribution: David Stosik commentedWoops, I think I forgot the attachment. :D
Comment #2
David Lesieur CreditAttribution: David Lesieur commentedI did not check your module yet, but from your description I understand that it is a complete rewrite of the existing module, with a different feature set (added AJAX goodies; provided no way to select what Exif data to show — IMO, losing the latter would be unacceptable to current users of the Exif module). To fully replace the existing module, you'd have to explain a little bit why it deserves to be ditched. ;-) If it does not deserves to be ditched, then the ideal process would probably be to take the best from the existing module, the best from yours, and join forces through the usual review process, small feature by small feature, to get an ever better module. Does that sounds good?
Comment #3
David Stosik CreditAttribution: David Stosik commentedHello,
This is actually a complete rewrite, more a proof of concept than a real module. :)
I started to develop this yesterday, then I realized an EXIF module was already existing. So, Before publishing my module, I chose to post this issue.
We can indeed join forces into developing a Drupal 6 version of your EXIF module, but I have some, well, "requirements". :)
Please have a try to my little work and tell me what you think of it. :)
I attached a slightly debugged version.
Regards, David
Comment #4
David Stosik CreditAttribution: David Stosik commentedHello again. :)
I ported your module to Drupal 6 quickly, and added AJAX system. PEL is still present, but I would like to know your (and users') point on getting rid of it.
Could you tell me what do you think of it?
I know it still needs commenting, a little bit theming, and cleaning, but it works. :)
Again, any thoughts are welcome.
Regards,
David
Comment #5
David Lesieur CreditAttribution: David Lesieur commentedThanks for the quick update! I did not review your work yet... (Btw, if you can provide patches, it will make the reviewing process less tedious).
Regarding PEL, I'm not too convinced about getting rid of it. If you can install the Exif module, then you can also install PEL. AFAIK, the only obstacle with PEL is the requirement for PHP 5, but then I'd say we should jump with the GoPHP5 movement anyways. I'm not too interested in reinventing the wheel and reimplementing everything PEL already implements, and then having to maintain that code base. Note that PEL also supports writing Exif data, which could open the door to interesting applications where images could be fully managed under a Drupal system.
If other users/developers have opinions on this subject, please share!
Other than that, I'll be happy to integrate a D6 port, and/or improvements/new features to the module. Ideally, these should be submitted as separate patches, since these are separate issues. Say one new feature is not really ready to be committed, while the D6 port is, then if both are in the same patch, both get delayed until the new feature is fixed...
I'll try to review this as soon as possible.
Comment #6
David Stosik CreditAttribution: David Stosik commentedI'll try to provide you with patches. ;)
Comment #7
David Stosik CreditAttribution: David Stosik commentedFirst patch: the Drupal 6 port. :P
Comment #8
David Stosik CreditAttribution: David Stosik commentedSecond patch: make an AJAX call on a button click to retrieve EXIF information.
This one needs previous patch to be applied before.
Comment #9
David Stosik CreditAttribution: David Stosik commentedAny news?
David, have you been able to test my patches?
Comment #10
David Stosik CreditAttribution: David Stosik commentedComment #11
wildtang3nt CreditAttribution: wildtang3nt commentedI cant seem to get your patches to apply. Can you describe in detail how you did them? I keep getting errors.
Comment #12
David Stosik CreditAttribution: David Stosik commentedI used diff -up command.
Could you tell me what are the errors you get?
I diffed exif.old/exif.module with exif/exif.module ...
Regards,
David
Comment #13
wanderingstan CreditAttribution: wanderingstan commentedMy 2 cents:
EXIF should eventually be a bundled sub-module of the Image module, in much the same way that Image Gallery is.
If the PEL requirement can't be removed, then it would be best to include a working version of it.
For any dependencies (PEL) or otherwise, the module should detect if it can run, and show an intelligent "I can't run because I'm missing dependencies" message rather than the PHP errors that are now generated.
I'm a developer working on a startup that will need the EXIF module, and would love to get involved with extending it. How can I best help?
Comment #14
David Lesieur CreditAttribution: David Lesieur commented@wanderingstan: Your points are worth discussing but off-topic... Please post each topic to a separate issue.
Comment #15
David Stosik CreditAttribution: David Stosik commentedDavid, could you tell me if you will include my patches?
Comment #16
David Lesieur CreditAttribution: David Lesieur commented@sto: Unfortunately, the patch does not apply. According to the patch file, your original files were dated August 13. It looks like you have worked from the last release, but updates have been made to the module since then (although no release has been published yet). Make sure to start from latest version, either through CVS or from the latest snapshot release.
Other than that, the patch looked clean... If it applied, it could have been approved!
Comment #17
macsim-1 CreditAttribution: macsim-1 commentedHello,
take a look on my exif module, it will work on your drupal 6.x
I've just update the past version with same fonctionalities except the possibility of a class added to the table display of the exif's infos
Sorry for my bad english,
I am from French.
Comment #18
David Lesieur CreditAttribution: David Lesieur commentedCould you provide a patch? It would make reviewing much easier.
Thanks.
Comment #19
David Stosik CreditAttribution: David Stosik commentedHello,
Sorry for the long time not answering...
Here is a 5 to 6 patch applying to HEAD.
Hope it gets applied and comitted before current HEAD gets obsolete. ;)
I think this first issue becomes critical, as Drupal 6 becomes the version to start with. :)
Regards,
David
Comment #20
David Stosik CreditAttribution: David Stosik commentedI really thought I attached my patch. :D
Comment #21
David Stosik CreditAttribution: David Stosik commentedComment #22
David Stosik CreditAttribution: David Stosik commentedWow, sorry for the multiple posts, but I am having a problem here... Maybe there's a probleme when uploading a file starting with a number. I'll try to rename it.
Edit: Very sorryfor the multiple posts, I realize I could have use the Edit function...
As I can't seem to upload my file to drupal.org, here is another URL:
path to EXIF 5 to 6 patch
Edit2:
And here is the AJAX patch, applying on previously patched code.
path to EXIF AJAX patch
Comment #23
David Stosik CreditAttribution: David Stosik commentedHello,
Any news?
Comment #24
David Lesieur CreditAttribution: David Lesieur commentedUnfortunately, I did not have time to review the patch yet, and I won't be able to this week. :(
In the meantime, other interested parties are encouraged to test, review, and report back!
Comment #25
David Lesieur CreditAttribution: David Lesieur commentedI have tested the patch. It seems to basically work, but any changes to the settings are never saved (this is caused by argument changes in D6 on form submit handlers).
I have tested only the Drupal 6 port at this point. Let's focus on Drupal 6 here and post the Ajax stuff to a separate issue, to make it easier to follow things up. Thanks!
Comment #26
meba CreditAttribution: meba commentedThe patch is not available anymore on that URL. Anybody having it so I can review it and update ?
Comment #27
David Lesieur CreditAttribution: David Lesieur commentedI have found a copy sto's patch (from #22) that was still lying around on my disk. It did not magically fix itself though and still needs work. :-)
Comment #28
aries CreditAttribution: aries commentedHere's the version of mine. Works for me.
Comment #29
AntiNSA CreditAttribution: AntiNSA commentedsubscribe
Comment #30
AntiNSA CreditAttribution: AntiNSA commentedCan you tell me will this embed the keywords into the database and make them searchable for drupal, like with gallery2?
Comment #31
metabits CreditAttribution: metabits commentedis anybody working on IPTC fields? caption, keywords and some other iptcs standards are more important to me than info about camera, iso, shutter speed and so on.
thanks anyway for your job!
psc
Comment #32
rapsli CreditAttribution: rapsli commentedworking on it... going to create a D6 Branch within the next days.
@david: Is that ok?
Comment #33
rapsli CreditAttribution: rapsli commentedGoing to rewrite this module, as I need it for a project.
- Features are going to be cCK integration, meaning the user can create a cck field (e.g. exif_model), which would then save the model exif tag for this node type. This allows full views integration plus the user can edit the exif data. The admin/settings/exif page would disappear as a result of this.
- I'm not going to use the exif library anymore.
- PHP5 only.
- imagefield support
@David. Is this ok with you?
Comment #34
wanderingstan CreditAttribution: wanderingstan commentedI would love to help with coding with this if needed.
- I love the idea of having associations between CCK fields and EXIF fields, with synchronization between the node field and the image metadata fields. If it was as simple as creating a CCK field named "exif_model", that would be amazing.
- Along with the earlier commenter, I would like to see the module support other metadata formats beyond EXIF -- IPTC and XMP in particular. ExifTools has a complete list of metadata tags that could in theory be supported.
Comment #35
rapsli CreditAttribution: rapsli commentedSince I'm not going to use the previously used library for exif it should not be a problem to support other formats. I'm gonna start tomorrow setting up a frame, where we can program in. Let's look on monday how we can split up the work, when we got some code in it.
As architecture I see the following:
exif.module -> drupal integration
exif.class.php -> a class containing all exif reading and processing (meaning .module only contains hook implementations)
Comment #36
AntiNSA CreditAttribution: AntiNSA commentedIf you can make sure the keyword characters allow more than 255 characters, like at least 1000 or more that would be great.. and make them fully searchable and cck them....
Comment #37
jamesJonas CreditAttribution: jamesJonas commented"I would like to see the module support other metadata formats beyond EXIF -- IPTC and XMP in particular" - XMP is a great suggestion. Thx
Comment #38
jamesJonas CreditAttribution: jamesJonas commentedSample XMP extraction using PHP. This may be a too specialized case, but it is informative.
http://photography-on-the.net/ee/beta/cs_xmp_to_exif.php
Comment #39
David Lesieur CreditAttribution: David Lesieur commentedBtw, I have never really looked at the code, but Feed Element Mapper might give some ideas or even reusable code for mapping data to taxonomy, CCK, or other types of fields. Even if there were no readily reusable code in there, perhaps there is an opportunity to join forces and create a generic framework for mapping data sources to fields.
Comment #40
rapsli CreditAttribution: rapsli commentedas promised a first version: http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/exif/?pathr...
tested it on two sites. I think there are some problems with the install?! Other than that it works very great! Awesome to integrate with CCK and the code is extremely simple and short.
@david: Is this oky, if I create a first alpha version of it for D6, so we get more people testing it.
Comment #41
David Lesieur CreditAttribution: David Lesieur commented@rapsli: Awesome! I have just created a snapshot release. It should get generated within the next few hours.
As this is a whole new codebase, I think it would be safer to gather some feedback on a dev version before releasing an alpha.
Unfortunately I did not have time to really review your work, but some quick suggestions:
Comment #42
David Lesieur CreditAttribution: David Lesieur commentedComment #43
TechDust CreditAttribution: TechDust commented@rapsli
I love to have this, but I'm a bit confused on how t install and test it.
All I want is the ability to display EXIF data (say, Camera, Aperture, speed, iso,...) along with an image (uploaded using ImageCache).
I'm trying to only use imagecache/imagefield rather than the Image module.
thanks in advance
Comment #44
rapsli CreditAttribution: rapsli commentedhave you read the readme?? It should work just fine with imagefield. If not, let me know.
Comment #45
TechDust CreditAttribution: TechDust commentedwow.... thanks for the quick response
I'm using drupal 6, php5, the dev6 of the module. I get the following error:
when I go to the site config > exif
I get the error, without any other option
* warning: read_exif_data() [function.read-exif-data]: Unable to open file in /www/sitename/sites/all/modules/exif/exif.module on line 112.
* warning: Invalid argument supplied for foreach() in /www/sitename/sites/all/modules/exif/exif.module on line 117.
thanks again
Comment #46
robert.oconnell CreditAttribution: robert.oconnell commentedI encountered the same problem.
Tracing through the code, I discovered my problem was that the node type containing my CCK-based image is "image". This apparently is the special node type name for the image module, which this module uses a different technique to find the file's path.
So, obviously one solution is to use a different node type name.
Lacking that on a "published" site, I'm not sure how to continue to use the module as is. I'll be modifying my site's module to comment out the following in exif.module:
Comment #47
dman CreditAttribution: dman commentedHello guys.
an off-topic cross-reference to a metadata merger for images that I'm playing with
I approached the problem from the other end.
I wanted to fill in titles and descriptions on files when importing them in bulk, so used a text file and hooked into image_import.
Then I saw I could tag them with keywords as well. Then figured I could add any metadata I find. And tried to find a way for metadata applied from Drupal to go back into the images for posterity.
So went looking for metadata methods and started using XMP. And EXIF also.
So got an EXIF reader library to support my metadata-onto-image-nodes process.
... and end up wondering if the EXIF.module has any of the same goals in mind. A look at the code available today looks useful?
[edit] fixed links
Comment #48
David Lesieur CreditAttribution: David Lesieur commentedBtw: The above link is broken but got it: #256195: Enhance image_import by allowing submitter to provide captions (plus a general-case solution)
One of the reasons for which I had initially chosen the PEL library (for the D5 version of exif.module) was its ability to not only read Exif data, but also write it. Read-write capabilities were a goal, although the current version of the Exif module is light-years from it!
Although I have not tried your code, it looks like a merger could make sense. However, I have too little time at the moment to help design a solution. I'll be happy to grant you CVS commit access if you'd like to step forward.
Some of my personal goals for metadata that come to mind:
Then the name "Exif" might be a bit limiting for a module that would do all this. :-)
Comment #49
dman CreditAttribution: dman commentedfixed links :-}
I'm also keen on the read-write idea. Eventually.
Our discussions in the thread are tending towards a generic file-metadata-hook-naming scheme. EXIF is certainly ONE of those.
Investigation has shown that the actual EXIF labels (never mind labels available to other media types) is all over the place, so mapping is certainly going to become important at some point.
Me, I'd like if RDF-in-core allows us to add arbitrary tags, but I guess for better Drupal integration a CCK and taxonomy compatible approach is the place to start.
Just the mapping UI is a bore to build and admin...
I've only worked with image.module nodes so far, but I realize the imagefield is the way of the future. Next time I pick up the job (not really active right now here either) I'll ping you back with suggestions on the API we can cooperate on.
Comment #50
geerlingguy CreditAttribution: geerlingguy commentedSubscribe.
Comment #51
radj CreditAttribution: radj commentedEvery photographer-slash-Drupal-developer's dream module. lol.
Comment #52
radj CreditAttribution: radj commentedEvery photographer-slash-Drupal-developer's dream module. lol. Subscribing! :)
Comment #53
chachasikes CreditAttribution: chachasikes commentedI had a problem with exif not reading iptc multiple keywords properly. It was only reading the first keyword into my cck textfield (field_iptc_keywords)
in exif.module line there is an innerkey concatenator -- i added this to exif.class.php and now it concatenates the terms into the single field.
see attached patch
Comment #54
chachasikes CreditAttribution: chachasikes commentedoh whoops - sorry - the previous patch is applied to the dev version (current head doesn't have exif.class.php)
it can be found here: http://drupal.org/node/598558
Comment #55
rapsli CreditAttribution: rapsli commentedcommitted to head
Comment #57
design10 CreditAttribution: design10 commentedImagefield has been turned into a widget for filefield. This mod does not work if you use a more recent version of imagefield.
Comment #58
rapsli CreditAttribution: rapsli commentedlet's keep this closed... just tested it and it seems to work just fine.