Exif module - lens type in exif ?

eliz82

Joined: 2009-11-06
Posts: 71
Posted: Thu, 2011-09-01 12:53

any idea how to add a lens type in exif for Canon cameras ?

i have found something very similar for Coppermine gallery that also use the same library as Gallery2 for reading exif.
so i have made the changes on canon.inc and exif.inc as in the coppermine forum post, but i'm stuck here.
http://forum.coppermine-gallery.net/index.php?topic=59103.0

the Canon exif documentation is here:
http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Canon.html#LensType

 
eliz82

Joined: 2009-11-06
Posts: 71
Posted: Thu, 2011-09-01 16:15

manage to show Canon LensType in the lens field.
i will attach the modification to this post. replace those 3 files with those in the archive, then go to Gallery2 Administration, go to Exif settings and add LensType to your summary or detailed view.

but they are 2 problems:
1) some of the programs like Adobe Photoshop strip LensType data from exif when save as jpeg. you can verify is you jpg have LensType data in exif with software like Exiftool or Photome. for example Canon DPP keep lenstype in exif for jpeg.
2) the third party lenses are not recognized . for exemple Sigma 150mm macro is recognized as "Canon EF 180mm Macro f/3.5L or Sigma Lens" . the strange thing is that Exiftool recognize the correct version, i have no idea how.

 
eliz82

Joined: 2009-11-06
Posts: 71
Posted: Thu, 2011-09-01 17:09

nikon documentation , if someone wants to make the same thing for nikon:
http://www.exiv2.org/tags-nikon.html
http://www.rottmerhusen.com/objektives/lensid/thirdparty.html

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Thu, 2011-09-01 18:12

Please update the bug tracker with your patches: http://sourceforge.net/tracker/?group_id=7130.

Remember to flag as "G2"
--
dakanji.com

 
eliz82

Joined: 2009-11-06
Posts: 71
Posted: Sat, 2011-09-03 07:33

i have search some documentation on this forum about exif module, but all threads referring to that are locked
example:
a thread with a newer exifer library (1.7): http://gallery.menalto.com/node/38219#comment-300417, a wanted to comment to say to mridgwel that (fractional) exposure time is not correctly represented for canon cameras.
and a thread with how to show lensdata for nikon lenses http://gallery.menalto.com/node/58721#comment-236449 , i wanted to say that i know why pavel.pola code don't work for other users, because they are some small mistakes in the code.

but I can't comment anything because you moderators locked all those threads. moderators have intentionally blocked the G2 development, without giving a serious alternative, because at this moment G3 is years away of having the same level of customization like G2.

i'm very disappointed of what is happened here.

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Sat, 2011-09-03 09:39

Have you updated the bug tracker?

While I agree the moderators everywhere are generally nothing but a pain in the neck :), on the old posts, you can always start a new post on the topic and put a link back to the old one ... just like you did to complain that they have been locked.

In terms of any development effort, if there will ever be one, the important thing is to put your problems, suggestions and patches etc on the tracker ... just like mridgwel did.

--
dakanji.com

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2011-09-03 17:16

Both threads unlocked.
In general it is good to start a new thread.

Dave
____________________________________________
Blog & G2 || floridave - Gallery Team

 
eliz82

Joined: 2009-11-06
Posts: 71
Posted: Sun, 2011-09-04 14:45

Thanks Dave. Maybe but not in this case, because an almost identical thread existed.
Dayo, i have no idea how to make a *.patch file, but maybe i will put an archive of the files on sourceforge.
----

so i have made another version with Lens identification where i included pavel.pola code for Nikon cameras. i will attach the modified files to my post.
example from my gallery of how the lens is detected from image exif:
Canon: http://www.fotonatura.ro/forum/album/eliz/landscapes/digital/IMG_23677.jpg.html
Nikon: http://www.fotonatura.ro/forum/album/mihaicj/Pasari/DSC_5362_cr.jpg.html

the problem with pavel.pola code for Nikon is that it not read the true LensID from adress 0098 from exif, but approximate some lens data using min/max focal and aperture using data from address 0084.
i have try to read the real LensId from the address 0098 but it seems this data is encrypted for newer nikon dSLR's.

the decryption algoritm is known and it's in the Exiftool source code, the only problem is that i don't understand PERL
http://cpan.uwinnipeg.ca/htdocs/Image-ExifTool/Image/ExifTool/Nikon.pm.html
from what i see it uses camera serial number read also from exif to decrypt the Lensdata. so maybe someone with a good understanding of perl can translate that description algorithm into php.

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Sun, 2011-09-04 16:07

You don't have to create a *.patch file. You can just report the issue in the patch tracker and post the proposed code to fix it there, including info on where it should go.
--
dakanji.com

 
eliz82

Joined: 2009-11-06
Posts: 71
Posted: Thu, 2012-02-16 01:16

.

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Fri, 2012-06-29 11:00

Implementations of the various fixes referenced have been provided by eliz82 and added to the unofficial G2.4.0 code base.
Testers and feedback required.

--
dakanji.com