PDA

View Full Version : Photo dates messed up (FIXED IN 2.02)


MikeCaine
31st of October 2006 (Tue), 15:29
I've just noticed that the dates on my photos are all messed up :(

I'm using the format DD-MMM-YYYY and dates that were previously OK are now showing as 22 Sep 2009 for example

All was OK on version 1.5 but it looks like I've got a load of work t do now to get them correct for verion 2.01

Is this a known problem? Is there a fix for this?

MikeCaine
31st of October 2006 (Tue), 15:43
Odd, once I've started I see that some are OK, some are screwed.

DavidW
31st of October 2006 (Tue), 16:54
I'm not clear whether the problem is with fresh uploads, or photos that were in the gallery before you upgraded. If it's from before you upgraded, take a look at the database (either examine a EE Backup file in a text editor, or look at the ee_photo table in phpMyAdmin) and see what you see.

If the problem is with fresh uploads, and you've edited the photos with Photoshop CS2, this patch (http://photography-on-the.net/forum/showthread.php?t=230992) may fix it. If so, feedback would be welcome in the other thread. If you have some other problem with fresh uploads, can you PM me to sort out sending me a file that EE won't correctly read the metadata from - I'm trying to fix metadata related bugs in EE.



David

MikeCaine
1st of November 2006 (Wed), 05:15
Hi David, thanks for your reply. I've only uploaded about 6 photos since the upgrade and they seem to be OK. I applied your patch a few days ago, when I noticed the shutter speeds were all wrong with the 6 I had uploaded, but I haven't uploaded any since applying your patch. I edit all of my photos in PS CS2

My problem relates to photos already in the database. However, I'm now have some doubts as to if it's an existing problem or a new problem. I first noticed it in my Seattle to San Francisco gallery. I'd uploaded all of the photos in the other that I wanted them to appear, which I assume is called "authors sort order" or similar, and all seemed OK. I think the gallery displayed them in date order, which was when I noticed some San Fran photos mixed in with the Seattle photos and that was when I noticed some dates were way out. It seems likely that they have been wrong all along, perhaps only a few, but they were very noticeable to me when viewed in date order.

I also noticed my Munich gallery was completely wrong, but again I'd previously only viewed it in my authors order and I may not have noticed the error

I'm also a little confused that I have to show them in either "date order - ascending" or "authors order - descending" to get similar ordered views

Regards

Mike

DavidW
1st of November 2006 (Wed), 12:08
If you still have the files you uploaded that you couldn't read the shutter speed correctly from in the UPLOAD folder (or you can upload them there again), it's worth seeing if the fixed ee_extract_xmp_data has solved the problem.

Go into Server Tools, press the CHANGE TO DIRECTORY 'UPLOAD' button, select a previously troublesome image in the drop down menu and press the VIEW COMBINED CAMERA DATA button. Do you now see sensible results?


It's quite possible that you weren't reading metadata correctly from some images before you incorporated my Photoshop CS2 compatibility fix. I found myself in that situation. I couldn't find any straightforward way to re-read the metadata from the troublesome images - in the end, I fixed my EE database by hand instead.



David

MikeCaine
1st of November 2006 (Wed), 16:57
One photo that I've checked shows 1/50 and f22 in the EXIF and 1/2 and f22 in EE after the patch (assuming I've applied it correctly)

Another one shows 1/50 and f14 in the EXIF and 1/4 and f14 in EE

All of the apertures seems correct, it's just the shutter speeds that are wrong

Regards

Mike

DavidW
2nd of November 2006 (Thu), 09:42
Does anything show in EE before my patch?

It would be useful if you could PM me information on where to get hold of one of the files, so that I can investigate for you.



David

MikeCaine
2nd of November 2006 (Thu), 14:45
Do you need the original RAW file, or a smaller jpeg version?

Mike

DavidW
2nd of November 2006 (Thu), 19:55
Whatever file EE can't read the metadata correctly from, please - which means the JPEG you're trying to upload to your gallery. There's no need for the RAW file. Deface the image if you wish, so long as it continues to show the same problem in EE.

I want to pick the metadata apart by hand to see what EE is getting wrong so that I can see about fixing EE.



David

MikeCaine
3rd of November 2006 (Fri), 04:44
I've put an image in http://www.mike-caine.com/tmp/

It's been through PS CS2 on an Apple iMac and according to PS and iView Media Pro the shutter speed is 1/50. When I upload it to my site EE 2.01 shows it as 1/2

The aperture always seems correct, it's just the shutter speed that's wrong. It's been wrong on all of the six or seven photos that I've uploaded since upgrading.

Thanks for your interest and help

Mike

MikeCaine
3rd of November 2006 (Fri), 04:47
PS - I generally shoot in TV (Shutter Priority) and EE never seems to get that correct either.

iView Media Pro correctly shows "Shutter Priority" and EE just shows "Auto"

DavidW
3rd of November 2006 (Fri), 13:49
A very quick set of checks shows that the bug is related to the internal EXIF code.

The XMP code (as amended by my Photoshop CS2 patch - though the changes aren't actually needed for this file) is working correctly - $xmp_shutterspeedvalue = 1/50 and $xmp_exposureprogram = Tv, as is the EXIF PHP extension (on my test server, the version from PHP 5.1.6).

If you have the internal EXIF code enabled, it reads ExposureTime 1/50 (correct) and ExposureProgram 0 (wrong), but by the time this gets to Combined Camera Data with the internal EXIF code enabled, this has turned into Shutter 1/2 (wrong) and Mode Auto (still wrong).


If you have the EXIF PHP extension on your server, enable that and the problem will go away. If not, it's a case of waiting for the EE code to be fixed. I will attempt to investigate further, though I still haven't got the FreeBSD DBG patch working which makes debugging relatively awkward.



David

MikeCaine
3rd of November 2006 (Fri), 14:33
If you have the EXIF PHP extension on your server, enable that and the problem will go away.

Brilliant!

Many thanks for that, I'm seeing 1/50 and TV mode on that image now.

That should save a lot of hassle in the future

Thanks again

Mike

DavidW
3rd of November 2006 (Fri), 15:03
I have actually suspected EE's internal EXIF code of not quite getting things right at times previously - now I have an example where it's clearly misbehaving.

A quick code read indicates that the problem lies somewhere in function EXIF_parse and all its EXIF_ child functions in SCRIPT_editor_functions.php. I wouldn't be surprised if the problem is in function EXIF_decodeTag, but this is all preliminary and I need to investigate this further. I wish I knew where Pekka got that code from, or whether it's "home grown".


Mike - I'm glad that you've got the EXIF extension available and can switch to using that. EE prefers EXIF values over XMP values if it has both. Hopefully I'll get further into what may be wrong with the internal EXIF code, but this work may get deferred, particularly until I get PHP debugging facilities set up.



David