![]() |
|
Time zone setting affects image metadata displayed - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: General support (https://forum.zenphoto.org/forum-4.html) +--- Thread: Time zone setting affects image metadata displayed (/thread-13896.html) |
Time zone setting affects image metadata displayed - kuzzzma - 25-12-2023 Not sure if it's a bug or a weird choice of behaviour... I've gallery of photos taken in different timezones, metadata for each image lists correct date, time and timezone (and can be viewed in Zenphoto admin too). I believe this is not a useful behaviour for this scenario (displaying photo metadata), as it can confuse visitors especially when dealing with photos taken in vastly different time zone - you can get a night photo with listed time taken at noon. Time zone setting affects image metadata displayed - acrylian - 26-12-2023 If you have "localized dates" enabled that could probably be the expected behaviour. Try if disabling makes a difference. Time zone setting affects image metadata displayed - kuzzzma - 26-12-2023 I'm not using "localized dates", tried to enable it to check - it just changes formatting, but not the addition of time-zone. Time zone setting affects image metadata displayed - acrylian - 26-12-2023 No it does not change "formatting" it translates/localizes dates, especially the day and month names and also does some conversion based on the locale and time zone. Besides everything uses the time zone as defined on the option and of course dates are displayed based on that. Including meta dates. That "localized" stuff is rather complicated in PHP 8+ now which is why it was not even correct in 1.6. Perhaps we can look into this for 1.6.2 later if it is not too complicated but probably we will need some test images with dates with different time zones. Time zone setting affects image metadata displayed - kuzzzma - 26-12-2023 It all boils down to function zpFormattedDate which is used for everything and adds time zone, but probably shouldn't be used for image metadata. I've got a few for you to test with: https://www.photo.private-universe.net/travel/uk/london/st-pauls-cathedral.jpg.html https://www.photo.private-universe.net/travel/russia/vladivostok/rusalka.jpg.html Currently my time zone setting is Europe/Moscow (+3 hours) Time zone setting affects image metadata displayed - acrylian - 27-12-2023
Ok, I think I get what you mean now. We'll take a look. Probably it could be an option or a parameter for printImageMetadata() to choose. Time zone setting affects image metadata displayed - acrylian - 26-01-2024 I finally have taken a look at this: I did test your St. Paul image above: ExifDateTimeOriginal 2013-08-28T21:17:16+01:00 is displayed as:
including the other dates:
The behaviour is technically correct as all PHP date functions either use the defined server timezone if no timezone is specified in the date itself (results in the "unconverted" date) or the specified timezone. It is not our function doing this but the date itself technically I can just remove the timezone parts from the string to get the plain "unconverted" date. Shouldn't we at least append the offset like 28.8.2013 22:17:16 (+01:00) to indicate another timezone? I am not sure if this should default option to the metadata options like "Ignore timezone in metadata dates" or similar. Time zone setting affects image metadata displayed - kuzzzma - 29-01-2024 I think that image metadata should be displayed as-is, unconverted by default. Adjusting date-time elsewhere on the website is absolutely necessary, but image metadata often already has timezones specified either in-camera or afterwards (I believe offset in test image is an indication of summer time adjustment). Time zone setting affects image metadata displayed - acrylian - 29-01-2024 Yes, probably you are right regarding the conversion. Time zone setting affects image metadata displayed - acrylian - 10-02-2024 I finally committed something to 1.6.2a using your images for testing. Please take a look. Time zone setting affects image metadata displayed - kuzzzma - 11-02-2024 I've tested it and works great! Note to others: I had to update my theme functions file too, as it used old code for some display modifications, so if it's not working for you - you might want to check what function your image page template uses (standard printImageMetadata or something else) Time zone setting affects image metadata displayed - acrylian - 12-02-2024 Thanks for the feedback. Yes, the change only applies to the standard |