Closed AlexanderSupp closed 1 year ago
btw. I uploaded both images in JoomGallery 3.6 without any problems.
For test, you can download the original image from JoomGallery 3.6 with following links:
After some tests I can confirm the problem after editing the metadata with windows.
First, I made a change to the title and subject in an image using windows 11 explorer.
Then I examined the dump of exif_read_data($img, null, 1)
in line 998 of IMGtools.php.
I found the following:
@AlexanderSupp Try changing line 144 of the file administrator/components/com_joomgallery/src/Service/Uploader/Uploader.php from
$data['imgmetadata'] = \json_encode($metadata);
to
$data['imgmetadata'] = \json_encode($metadata, JSON_INVALID_UTF8_IGNORE);
Then the metadata should be stored again, but with lots of strange characters...
@Elfangor93 What do you think which metadata sections should be stored in which form in the images table? Do you know https://github.com/pel/pel? Maybe it is possible to use it to read the manufacturer-specific tags for example?
I changed the source in Uploader.php with the following result. Data from Windows 11 File Explorer:
Data in Image Metadata:
As you see, there are no complete metadata in JG4 like in Win11 File Explorer. I think we must store all metadata like every tool on the market. And then we must decide, which metadata we will use in our processes like Tabs, GPS, Title, Author, and others.
@MrMusic There is no easy answer for handling metadata. When it comes to the WINXP fields then it could help to follow the instructions from here: https://www.php.net/manual/fr/function.exif-read-data.php#73645 But we will soon find another tool which will not be compatible anymore because many tools are storing metdata in different ways. We will always have strang behavior as long as we stitch to the php default functions (exif_read_data and iptcparse)...
Possible fix see issue #90
On the way to reconstructing issue #68, I proceeded as follows: Upload a large image. Processing successful.
Screenshot 2023-01-19 165419
Screenshot 2023-01-19 165449
Screenshot 2023-01-19 171042
Copy of the same image using Microsoft File Explorer, Detail View, Detail Area in properties (tags, titles, authors, comments, subject) modified.
Screenshot 2023-01-19 181313
Modified image uploaded.
Processing complete, but image metadata data is missing.
Screenshot 2023-01-19 170734
Image metadata controlled with XnViewMP.
Screenshot 2023-01-19 181313
Screenshot 2023-01-19 172326
Screenshot 2023-01-19 172755
Screenshot 2023-01-19 172949
Screenshot 2023-01-19 173127
Conclusion: After saving the mentioned properties, Microsoft reduces the file size?!. The EXIF tool provides two warnings (screenshot 2023-01-19 172755). All characteristics are still present, but not in JG4. I can imagine that the error in issue #68 is a subsequent error, which unfortunately I can't reconstruct until now. Therefor I opened this new issue. My original image for testing? Sorry, more than 10 MB.