has someone already created a module that displays exif data (aperture/shutter/iso/camera/lens/date) as a neat block in the sidebar?
i have the exif popup installed but would like to see this info automatically displayed in the sidebar. thanks!
I had to considered that but I am not enough of a programmer to know how to make the calls. If someone could at least provide me with how to do one of the fields I could probably figure it out from there. Please help. An example using the shutter speed should be more than sufficient.
undagiga
Joined: 2010-11-26
Posts: 693
Posted: Mon, 2011-11-14 01:19
It could be so extended. I'm not sure about the calls either, as Bharat wrote this part for me, but in principle it shouldn't be hard. I haven't done it because only other photographers want to know this. I'm mainly interested in showing people information about what's in the image.
timned88
Joined: 2011-08-31
Posts: 90
Posted: Mon, 2011-11-14 01:36
like i said, i could figure out style and format once i had an example on how to make a call and return the value... i am a hacker/modder but not a programmer.
yes, but i only want to display Camera Model, Aperture, Exposure Time, ISO, Date/Time
i can mess with the CSS to make the colors work to my scheme so if you can help edit it down that last little bit it would be awesome.
THANKS
timned88
Joined: 2011-08-31
Posts: 90
Posted: Tue, 2011-11-29 13:08
dave, any chance of finishing this off? really looking forward to it!
floridave
Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2011-11-29 21:19
Im out of town right now and have a very crude way and will be making a module on my return. Should be this weekend.
Save the attached replacing the existing file.
exif_sidebar.html.php
You will be able to edit the table with the data you want from the EXIF info.
I'm sure there is a better way to do this but it should be easy to follow so you can edit to your desires.
weirdly, the $Date function returns the make of the camera, in my case "Canon".
floridave
Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2011-12-05 19:23
Some cameras have different EXIF data so try the $DatenTime setting. you might have to view the data from the EXIF module and add to the list that I built there as there might be more data than I have listed available.
Glad it worked out for you.
here ya go...
ALSO... if its not too much to ask, can you work in the "this photo has been viewed X times" from a bit lower in the sidebar to the exif hack?
floridave
Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2011-12-11 01:46
Your eyes must be good. I can hardly see that. That and the fact that the image does not have any EXIF data so it is hard to test the image to see what this UGLY output is. I see a date and time, is that UGLY?
Yes,t the format of the output is ugly. That's what i am trying to fix.
floridave
Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2011-12-11 05:24
I'm not following you have to be specific.
I need examples of what image has the data and how you are retrieving it, how it is UGLY, and what is needed to make it not UGLY.
So to summarize I need:
an example image with the EXIF data
How you are retrieving it
How it displays
How to would look not UGLY
I have a problem with the template and I think it is because I use German as the default language. I attached my current exif_sidebar.html.php that works just works fine except for the camera model (it is shown as Canon, but should be EOS 20D) and I think this is because I don't have the correct german translation for it's entry and I can't seem to find where those are stored. You can have a look at it here: http://digination.de/index.php/Pflanzenvielfalt/IMG_0003
timned88
Joined: 2011-08-31
Posts: 90
Posted: Sun, 2011-12-11 18:13
floridave wrote:
I'm not following you have to be specific.
I need examples of what image has the data and how you are retrieving it, how it is UGLY, and what is needed to make it not UGLY.
So to summarize I need:
an example image with the EXIF data
How you are retrieving it
How it displays
How to would look not UGLY
is there any way to work the number of times viewed into this mod? that would make it perfect. thanks for all of your help.
Crawler
Joined: 2011-12-11
Posts: 9
Posted: Sun, 2011-12-11 19:01
Yes, you are right. But that's not the problem. The problem is, that when I use the English captions, I get Canon displayed for every entry. Only when I translate them into German it seems to work. And I don't now what the correct translation for 'Camera Model' should be. The file attached is the one I sue now, that displays for both, maker and model, the same entry (namely Canon).
The main problem seems to be, that your mod only works with English as the used language. Could you perhaps look into that?
floridave
Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2011-12-12 02:24
Quote:
The problem is, that when I use the English captions, I get Canon displayed for every entry.
I'm no EXIF data expert but I don't think that "Blende" is a EXIF standard: $Aperture = multidimensional_search($details, array("caption" => "Blende")); is right
Try $Aperture = multidimensional_search($details, array("caption" => "Aperture"));
Then you can use the German work in the table not in the variables extracted from the array.
If that does not work then you are going to have to start a new thread and see if there is any multi-lingual / EXIF experts that can help out.
You can do
<pre>
<?
print_r($details);
?>
</pre>
at the end of the file to see what words are used in the array.
that sure did. this little hack project is getting better and better all the time. thanks, dave.
Crawler
Joined: 2011-12-11
Posts: 9
Posted: Mon, 2011-12-12 08:31
Thank you a 1000 times. That actually worked. The German captions must be Kamera Hersteller (maker) and Kamera Modell (model). Now everything is displayed perfectly.
floridave
Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2011-12-12 14:48
One thing I did discover is that some image have some EXIF data and some don't. So for example if Data is available in some images and Date/Time might be in others you might get some invalid output to a variable that is not set or it grabs the first variable in the array.
Formatting the date from a variable is more of a pain than I expected. Some times I'm like a dog with a bone and dig for a long time , but this is getting frustrating. I'm still digging.
I was on the road when this started up and not in a position to get involved. I thought the idea was to base the new module on "About this photo", but Dave went in a different direction.
if (module::is_active("exif")) {
$exif = ORM::factory("exif_record")->where("item_id", "=", $theme->item()->id)->find();
if ($exif->loaded()) {
$exif = unserialize($exif->data);
$timestamp = strtotime($exif["DateTime"]);
$block->content->date = date('D j M Y', $timestamp);
$block->content->time = gallery::time($timestamp);
}
}
Formatting the date uses the variables D j M Y in "date('D j M Y', $timestamp)". You can vary the formatting by changing the variables, noting that case is very important.
U-G
timned88
Joined: 2011-08-31
Posts: 90
Posted: Thu, 2011-12-15 04:31
yes, i have that running on my side in a separate module. how would i combine that with the exif module to make it appear seamless (i.e. where to copy/paste the above code, and how to call it to display the date). thanks!
undagiga
Joined: 2010-11-26
Posts: 693
Posted: Fri, 2011-12-16 23:05
I have to admit that I'm a little confused. When I made my previous post I thought Dave had created a new module. Reading the thread again I'm not so sure. Which module is the file exif_sidebar.html.php that he provided for? Some of the posts seem to imply that people are basing their work on About this photo. I don't mind either way, but I want to understand so that I help and not confuse others.
Also rereading the thread again I see that Dave already gave the sort of advice in http://gallery.menalto.com/node/104245?page=1#comment-384897 that I was trying to provide. The key to getting the date format that you want is to start with a date and time variable and use the PHP date function to format it. In Dave's post he suggested
So the variable $DatenTime is the combined date and time variable that he retrieves in his exif_sidebar.html.php file. The documentation for the PHP date function is http://php.net/manual/en/function.date.php . You construct the date format you want by replacing "F j, Y" in the above code with the variables you want chosen from the documentation. If you're using Dave's exif_sidebar.html.php I guess you'd need to add a new row which displays the $new_date variable based on the above code.
I hope this helps and doesn't simply add to the confusion.
U-G
timned88
Joined: 2011-08-31
Posts: 90
Posted: Tue, 2012-01-10 16:45
ok, to clarify, i am using a heavily modified version of the exif module which is doing most of what i want it to do. i originally began messing with the about this photo module but found the exif module, once modded, was truer to my original intention.
i am now trying to find out where to implete your code ($new_date = date("F j, Y", strtotime($DatenTime));) into that module to produce the date/time output that i am looking for.
here is the complete code from exif_sidebar.html.php that i am running on my site:
the problem i am having is the $FDatentime variable produces output that looks like this - TimeStamp: 2011:06:18 19:56:10
floridave
Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2012-01-13 05:41
I forgot that the EXIF data is serialaized.
My way is way to much code for what you are after. If I get time I might create a new module for EXIF in the sidebar similar to waht you have.
I have a question that is not directly (or only) linked to exif_sidebar.php. I got everything working as I want it to (see http://digination.de/index.php/Nikon-D90-Impressionen/DSC_0831) My problem now is, that I want to re-arrange the sidebar-items, but in the admin panel I can't move the EXIF-information because it doesn't show up. All the other entries (album tree, social links, picture download) can be arranged via the admin panel. Can anyone tell me how to get the EXIF information to the top of the sidebar?
Crawler
Joined: 2011-12-11
Posts: 9
Posted: Mon, 2012-07-02 19:16
I just found out, that when I change line 21 in /modules/exif/helpers/exif_theme.php from 'static function sidebar_bottom' to 'static function sidebar_top' the EXIF-box moves to the top of the sidebar. How could I use this to put it on the second position?
Posts: 1857
You could hack (edit) the "about this photo" module: http://codex.gallery2.org/Gallery3:Modules:about_this_photo
If you need help with it, there's a thread for the module: http://gallery.menalto.com/node/100075
Posts: 27300
The about this photo module might. If not i bet it could be extended to do so.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 90
I had to considered that but I am not enough of a programmer to know how to make the calls. If someone could at least provide me with how to do one of the fields I could probably figure it out from there. Please help. An example using the shutter speed should be more than sufficient.
Posts: 693
It could be so extended. I'm not sure about the calls either, as Bharat wrote this part for me, but in principle it shouldn't be hard. I haven't done it because only other photographers want to know this. I'm mainly interested in showing people information about what's in the image.
Posts: 90
like i said, i could figure out style and format once i had an example on how to make a call and return the value... i am a hacker/modder but not a programmer.
Posts: 27300
is this how you want it displayed?
http://www.langleycom.com/gallery3/index.php/Test1/IMG_1444
looks to me like the sidebar is not that wide or you can make it one column I guess.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 90
yes, but i only want to display Camera Model, Aperture, Exposure Time, ISO, Date/Time
i can mess with the CSS to make the colors work to my scheme so if you can help edit it down that last little bit it would be awesome.
THANKS
Posts: 90
dave, any chance of finishing this off? really looking forward to it!
Posts: 27300
Im out of town right now and have a very crude way and will be making a module on my return. Should be this weekend.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 90
awesome! SO looking forward to it.
Posts: 27300
Save the attached replacing the existing file.
exif_sidebar.html.php
You will be able to edit the table with the data you want from the EXIF info.
I'm sure there is a better way to do this but it should be easy to follow so you can edit to your desires.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 90
works perfectly, dave! exactly what i wanted. THANKS!
here is a sample page... after i styled it a bit to suit.
http://themagicinpixels.com/gallery3/index.php/Magic-Kingdom/Liberty-Square/The-Haunted-Mansion/Haunted-Mansion-New-Cemetery-2011-08/Haunted-Mansion-Cemetery-08-2011-_J0E1214
weirdly, the $Date function returns the make of the camera, in my case "Canon".
Posts: 27300
Some cameras have different EXIF data so try the $DatenTime setting. you might have to view the data from the EXIF module and add to the list that I built there as there might be more data than I have listed available.
Glad it worked out for you.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 90
i tried that one but it produces UGLY output. is there a way to stylize the output to more conventional means?
Posts: 27300
I have not seen the UGLY bit but can only assume that the formatting is not right.
Try this:
$new_date = date("F j, Y", strtotime($DatenTime));
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 90
where would you implement this new piece of code?
Posts: 27300
I would have to test this before I get too far. Got a image with the UGLY output and what code are you using to get the output.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 90
here ya go...
ALSO... if its not too much to ask, can you work in the "this photo has been viewed X times" from a bit lower in the sidebar to the exif hack?
Posts: 27300
Your eyes must be good. I can hardly see that. That and the fact that the image does not have any EXIF data so it is hard to test the image to see what this UGLY output is. I see a date and time, is that UGLY?
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 90
Yes,t the format of the output is ugly. That's what i am trying to fix.
Posts: 27300
I'm not following you have to be specific.
I need examples of what image has the data and how you are retrieving it, how it is UGLY, and what is needed to make it not UGLY.
So to summarize I need:
an example image with the EXIF data
How you are retrieving it
How it displays
How to would look not UGLY
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 9
I have a problem with the template and I think it is because I use German as the default language. I attached my current exif_sidebar.html.php that works just works fine except for the camera model (it is shown as Canon, but should be EOS 20D) and I think this is because I don't have the correct german translation for it's entry and I can't seem to find where those are stored. You can have a look at it here: http://digination.de/index.php/Pflanzenvielfalt/IMG_0003
Posts: 90
the way the timestamp is printed comes out like this: 2010:11:08 22:48:43 i would rather it appear as 11/08/2010. that's what i meant by UGLY.
i have left it active on my site so you can see it in play... http://www.themagicinpixels.com/gallery3/index.php/Epcot/World-Showcase/Norway/Spirit-of-Norway/Spirit-of-Norway-2009-12/Spirit-of-Norway-12-2009-003 for one example.
Posts: 27300
you have the same value from the array for each variable.
The attached should work.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 27300
OK now I understand
let me work on that
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 90
is there any way to work the number of times viewed into this mod? that would make it perfect. thanks for all of your help.
Posts: 9
Yes, you are right. But that's not the problem. The problem is, that when I use the English captions, I get Canon displayed for every entry. Only when I translate them into German it seems to work. And I don't now what the correct translation for 'Camera Model' should be. The file attached is the one I sue now, that displays for both, maker and model, the same entry (namely Canon).
The main problem seems to be, that your mod only works with English as the used language. Could you perhaps look into that?
Posts: 27300
I'm no EXIF data expert but I don't think that "Blende" is a EXIF standard:
$Aperture = multidimensional_search($details, array("caption" => "Blende"));
is rightTry
$Aperture = multidimensional_search($details, array("caption" => "Aperture"));
Then you can use the German work in the table not in the variables extracted from the array.
If that does not work then you are going to have to start a new thread and see if there is any multi-lingual / EXIF experts that can help out.
You can do
at the end of the file to see what words are used in the array.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 27300
<?= $theme->item()->view_count; ?>
Should do the trick.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 90
that sure did. this little hack project is getting better and better all the time. thanks, dave.
Posts: 9
Thank you a 1000 times. That actually worked. The German captions must be Kamera Hersteller (maker) and Kamera Modell (model). Now everything is displayed perfectly.
Posts: 27300
One thing I did discover is that some image have some EXIF data and some don't. So for example if Data is available in some images and Date/Time might be in others you might get some invalid output to a variable that is not set or it grabs the first variable in the array.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 90
Dave, once we get the date format squared up, this will be one of your most useful mods yet. Thank you so much!
If you go to any page in my gallery (for instance http://www.themagicinpixels.com/gallery3/index.php/Disneyland-Park/Tomorrowland/Star-Tours/Star-Tours-6-2011/Star-Tours-06-2011-020) you can see how I am implementing your code.
Posts: 27300
Formatting the date from a variable is more of a pain than I expected. Some times I'm like a dog with a bone and dig for a long time , but this is getting frustrating. I'm still digging.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 90
well, i certainly appreciate your efforts!
if it helps, to get the format i am looking for, i modded the about this photo mod to suit. i have activated it back up on my site so you can see it in play, right under the exif hack.
http://www.themagicinpixels.com/gallery3/index.php/Disneyland-Park/Tomorrowland/Star-Tours/Star-Tours-6-2011/Star-Tours-06-2011-020
Posts: 693
I was on the road when this started up and not in a position to get involved. I thought the idea was to base the new module on "About this photo", but Dave went in a different direction.
If you look at http://codex.gallery2.org/Gallery3:Modules:about_this_photo you will see that the Date is formatted closer to how you want. The relevant code from the helper file is
Formatting the date uses the variables D j M Y in "date('D j M Y', $timestamp)". You can vary the formatting by changing the variables, noting that case is very important.
U-G
Posts: 90
yes, i have that running on my side in a separate module. how would i combine that with the exif module to make it appear seamless (i.e. where to copy/paste the above code, and how to call it to display the date). thanks!
Posts: 693
I have to admit that I'm a little confused. When I made my previous post I thought Dave had created a new module. Reading the thread again I'm not so sure. Which module is the file exif_sidebar.html.php that he provided for? Some of the posts seem to imply that people are basing their work on About this photo. I don't mind either way, but I want to understand so that I help and not confuse others.
Also rereading the thread again I see that Dave already gave the sort of advice in http://gallery.menalto.com/node/104245?page=1#comment-384897 that I was trying to provide. The key to getting the date format that you want is to start with a date and time variable and use the PHP date function to format it. In Dave's post he suggested
$new_date = date("F j, Y", strtotime($DatenTime));
So the variable $DatenTime is the combined date and time variable that he retrieves in his exif_sidebar.html.php file. The documentation for the PHP date function is http://php.net/manual/en/function.date.php . You construct the date format you want by replacing "F j, Y" in the above code with the variables you want chosen from the documentation. If you're using Dave's exif_sidebar.html.php I guess you'd need to add a new row which displays the $new_date variable based on the above code.
I hope this helps and doesn't simply add to the confusion.
U-G
Posts: 90
ok, to clarify, i am using a heavily modified version of the exif module which is doing most of what i want it to do. i originally began messing with the about this photo module but found the exif module, once modded, was truer to my original intention.
i am now trying to find out where to implete your code ($new_date = date("F j, Y", strtotime($DatenTime));) into that module to produce the date/time output that i am looking for.
here is the complete code from exif_sidebar.html.php that i am running on my site:
the problem i am having is the $FDatentime variable produces output that looks like this - TimeStamp: 2011:06:18 19:56:10
Posts: 27300
I forgot that the EXIF data is serialaized.
My way is way to much code for what you are after. If I get time I might create a new module for EXIF in the sidebar similar to waht you have.
Either way this should get you the proper date:
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 90
Thanks, Dave. Where does this code go? I will try to implement it right away.
Posts: 27300
Just replace
<?= $details[$DatenTime]["value"] ?>
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 90
shot.... SCORE! thanks, dave!
Posts: 1
here my shorten version ;-)
Its just output, no formating and else
Posts: 9
I have a question that is not directly (or only) linked to exif_sidebar.php. I got everything working as I want it to (see http://digination.de/index.php/Nikon-D90-Impressionen/DSC_0831) My problem now is, that I want to re-arrange the sidebar-items, but in the admin panel I can't move the EXIF-information because it doesn't show up. All the other entries (album tree, social links, picture download) can be arranged via the admin panel. Can anyone tell me how to get the EXIF information to the top of the sidebar?
Posts: 9
I just found out, that when I change line 21 in /modules/exif/helpers/exif_theme.php from 'static function sidebar_bottom' to 'static function sidebar_top' the EXIF-box moves to the top of the sidebar. How could I use this to put it on the second position?
Posts: 27300
http://codex.gallery2.org/Gallery3:Modules:exif_sidebar
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team