ITCP keyword metadata is removed from uploaded file ITCP keyword metadata is removed from uploaded file
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

ITCP keyword metadata is removed from uploaded file

Started by mark22, June 18, 2010, 02:26:12 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

mark22

Need to retain metadata in file

Here is the situation; I have an image file that I have added keywords to with Photoshop (or other software). 

I have 'Read IPTC data from JPEG files' enabled. I have 'Watermark images' disabled. I have the maximum size in bytes and pixels set larger than the image I am uploading. I have left the 'Quality of JPEG files' at the default of 80%.

I upload the image using the web interface. The keywords from the image are added to the database.
I browse to this image in Coppermine and save the 'original' to my hard drive. The image in KB is smaller than the one that I uploaded and the metadata keywords have been removed.

I hope you don't think these are separate questions, I think they are related.

I need the metadata keywords to remain in the file. How do I prevent them from being removed?

Is this caused by the file being rewritten? I would like the image to be copied not rewritten if possible.
I understand the JPEG quality setting applies to the 'normal' and thumbnail images, is it also applied to recompressing the 'original', and if so, could it be a separate setting?

I am new to Coppermine and PHP. I have someone I work with that is experienced in PHP.
I have searched through the forum and do not see this question addressed. We have read through what seems to be the relevant PHP.
We are still testing Coppermine to see if it meets our needs and it is running on a server inside our firewall and with some proprietary images, so I cannot provide a link. This is a basic installation without any add-ons etc. This is a new, recent installation, cpg156.

Thanks in advance, Mark

Αndré

Quote from: mark22 on June 18, 2010, 02:26:12 AM
I browse to this image in Coppermine and save the 'original' to my hard drive.
What's the name of that file. Please post an example. Please also post your watermark settings.

Quote from: mark22 on June 18, 2010, 02:26:12 AM
How do I prevent them from being removed?

Is this caused by the file being rewritten?
GD (and maybe ImageMagick, too) cannot handle meta data. If the file is touched, it will be lost. But the file shouldn't be touched with the correct settings.


If you can, please use the latest svn checkout and test again, as we recently changed a small thing in the resizing process.

mark22

Hi Thanks,

Between your reply and a few more experiments I think I understand what is going on.

I tried several things, but the 'solution' is in the Configuration, File settings, the check box 'Auto re-size...'

Even though the file size and pixel size limits are larger than the uploaded file, it re-sizes it in compression, or quality value. Which makes sense I suppose. When I change this to -No for everyone- the metadata is retained. I would like to try ImageMagick and see if it can resize and retain metadata.

What is the svn checkout?

Thanks again, how do I mark this 'solved'?



papukaija

Quote from: mark22 on June 18, 2010, 10:29:56 PM

What is the svn checkout?
See here.

Quote from: mark22 on June 18, 2010, 10:29:56 PM
Thanks again, how do I mark this 'solved'?
This is explained here.

In addition, you have not posted a link to your gallery as requested by board rules.

Αndré

Quote from: mark22 on June 18, 2010, 10:29:56 PM
Even though the file size and pixel size limits are larger than the uploaded file, it re-sizes it in compression, or quality value. Which makes sense I suppose.
That's not intended afaik.

mark22

I would think that the 'auto resize check box' is not entirely clear, it states pixel size not compression as the factors.

Perhaps it could be 2 check boxes?

Regarding posting a link to my gallery, I explained on the first post it is on a company server inside a firewall

Joachim Müller

No problem, just post the link anyway, even if we can't access it.

Αndré

Quote from: mark22 on June 19, 2010, 10:37:29 PM
I would think that the 'auto resize check box' is not entirely clear, it states pixel size not compression as the factors.
It should only resize your picture if the dimensions are bigger than the entered values. We don't check for compression.

mark22

It seems to resize regardless of pixel dimensions if resize is turned on.
I did several experiments with this. I took a jpg file and saved it in the highest quality in Photoshop.
The pixel dimensions are 986 X 656. The file size, saved in highest quality is 412 KB.
Not e the allowed file size in pixels and KB are larger than the test file. I also turned up the max file size in php.ini.

For the relevant experiments I changed only 2 variables:
Quality for JEPG files, which I set at 100% and 80%
And
Auto resize images that are larger than max width or height, which I set at No and Yes: Everyone
The results,
if Quality is set to 100 and Auto resize is set to Yes the file is re-written. The file on the server is only 98 KB and the meta data is removed.
if Quality is set to 80 and Auto resize is set to No the file is not re-written. The file on the server is original size, 412 KB and the metadata is retained.
Attached is 'original' test image and screen shot of settings

mark22


I marked this solved, the reason the meta data is removed is that the file is re-written by GD
Maybe a new thread would be 'image is re-written' when it shouldn't be?

Αndré

The file size doesn't matter. I will perform some tests tomorrow. No need for a new thread imo.

Αndré

I cannot confirm, that the image file is re-written if it's smaller than the maximum dimensions. I tested it with simple upload, flash uploader and batch-add. Everytime the same result: file is not re-written, meta data is still there.

mark22

File rewrite 6 24 2010

Crazy...   not you

I just tried it again and the behavior is as I described.

This is a 'stock' installation of CM 156, installed on June 8 2010

Here is what I did this morning:

Test 1

I took a jpg file and in Photoshop added some keywords, description and title.
I saved it at the maximum quality, 12
The file name is:                            CM test keywords c2l.jpg
The size on the local HD is 134 KB
The pixel dimensions are: 600 X 398
In the CM file configuration I have the following settings:
Quality of JPEG 80%
Max size for uploaded files 8024 KB
Max width or height for uploaded pictures 4500 pixels
Auto resize images that are larger than max width or height Yes: Everyone
See attached screen shot:         file setting - test 1 - 6 24 2010 9-33 am.jpg
I uploaded to my CM with the Flash interface
The keywords etc are read and put in the database
I downloaded the full size file from CM, right click and save
dl from CM t1 - CM_test_keywords_c2l.jpg
The downloaded file is only 41 KB and does not have any meta data according to Photoshop
I also looked in the usepics folder to see if it is the same as the dl file, which it is
See screen capture of the folder, this file is the 6th file from the top:
userpics folder screen.jpg

Test 2

I started with the same jpg, drew on it in Photoshop so I can tell it apart and saved it at the max quality
The file size of this on the local HD is slightly larger than before at 143 KB
t2 - CM test keywords c2l.jpg
In the Coppermine configuration I changed only one setting,
Auto resize images that are larger than max width or height No
I upload and downloaded in the same way
The file after download is 143 KB and has the metadata in Photoshop
dl from CM t2 - t2_-_CM_test_keywords_c2l.jpg
The file in userpics is the 3rd from the top in screen shot:
userpics folder screen.jpg


http://10.10.1.75/cpg156/index.php

A story from a friend that worked tech support in the time of DOS. He is trying to get the user to copy a file, he keeps repeating, "Type copy file.xxx" and user keeps saying "it doesn't work" finally he says "read it back to me, letter by letter" and the user reads "copy file dot xxx".



mark22

The forum only allowed me to upload 5 of the explanatory images, but the larger, in KB jpg would represent the originals before upload

Αndré

Do you test with the latest svn checkout or with the official cpg1.5.6 package?

mark22

One of our IT people installed and set this up for me
I assume he only did what the 'official' straight forward dl and set up had him do

I will track him down and see if he can install the sub version

Is this just a matter of replacing a few files over the existing ones?

Thanks, Mark


mark22

Now I am a bit confused, is the current upgrade you refer to include the latest sub version? If we dl'ed and installed CM a couple weeks ago, and the version number is the same, will this upgrade be different than what we installed? Let me go over the situation and documents with our IT guy and see how it goes.

I also have a comment and tip regarding meta data - meta data editors etc, I will post that as a new topic

Thanks again

Αndré

You should use the latest svn checkout to upgrade your gallery (or testbed) if you can. Maybe the issue is already fixed there. Here are some more information about svn: http://documentation.coppermine-gallery.net/en/dev_subversion.htm#dev_subversion_download