Advanced search  

News:

cpg1.5.42 maintenance release - upgrade recommended
The Coppermine development team is releasing an update for Coppermine in order to fix several minor issues. All fixes are not security critical, so if your gallery is running fine with cpg1.5.36, cpg1.5.38 or cpg1.5.40 you don't need to upgrade. If you are running an older version than cpg1.5.36, you must update to this latest version as soon as possible because of the security impact!
[more]

Pages: [1]   Go Down

Author Topic: Empty spaces inside photo's description textfield.  (Read 3255 times)

0 Members and 1 Guest are viewing this topic.

flapane

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: it
  • Offline Offline
  • Gender: Male
  • Posts: 249
    • Flavio's page
Empty spaces inside photo's description textfield.
« on: January 01, 2015, 05:39:19 PM »

I noticed that if I upload some photo and then add a description, the description text field contains 31 empty spaces which must be manually deleted.
I couldn't find any setting where to set the default text of the photo's description, nor Firebug or theme.php seem to help.
Any hints?
Thank you and happy new year

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15171
Re: Empty spaces inside photo's description textfield.
« Reply #1 on: January 01, 2015, 09:52:26 PM »

I cannot replicate that issue in my testbed. Maybe the description has automatically be imported by IPTC data?
Logged

flapane

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: it
  • Offline Offline
  • Gender: Male
  • Posts: 249
    • Flavio's page
Re: Empty spaces inside photo's description textfield.
« Reply #2 on: January 01, 2015, 11:07:37 PM »

Ugh, that's interesting: it looks like that Photoshop CS5 is somehow adding those spaces in the description field. It doesn't happen if I resize the photo with another software.
It didn't happen with my previous Nikon D80 camera nor it happens with a Samsung S4 Mini.
It seems that the issue occurs when editing JPG files produced by a relatively recent Sony A6000 camera.
What's even stranger is that Windows 7 x64 doesn't show such empty spaces in "file properties --> desciprition".

It doesn't happen if I upload an untouched 24Mpix A6000 JPG file, so it's definitely Photoshop CS5's fault.

I may disable IPTC data import feature, given that I don't insert location/title/keywords in the JPG file.
Otherwise, if you want I can attach an A6000 jpg file, and if it turns out that it happens with more recent versions of Photoshop, an exception for A6000 desciprion field could be added to cpg source code.
« Last Edit: January 01, 2015, 11:13:05 PM by flapane »
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15171
Re: Empty spaces inside photo's description textfield.
« Reply #3 on: January 01, 2015, 11:28:42 PM »

Open include/picmgmt.inc.php, find
Code: [Select]
                $title = (isset($iptc['Headline'])) ? $iptc['Headline'] : $title;
                $caption = (isset($iptc['Caption'])) ? $iptc['Caption'] : $caption;
and replace with
Code: [Select]
                $title = (isset($iptc['Headline'])) ? trim($iptc['Headline']) : $title;
                $caption = (isset($iptc['Caption'])) ? trim($iptc['Caption']) : $caption;

This should fix the issue for future uploads. It's maybe a good improvement for the core code, so please confirm if it works as expected.
Logged

flapane

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: it
  • Offline Offline
  • Gender: Male
  • Posts: 249
    • Flavio's page
Re: Empty spaces inside photo's description textfield.
« Reply #4 on: January 03, 2015, 11:19:36 PM »

trim() does the trick, so I can confirm that it fixes the issue.

As usual, thanks for your help!

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15171
Re: Empty spaces inside photo's description textfield.
« Reply #5 on: January 08, 2015, 11:43:05 PM »

Committed in SVN revision 8757. Will be part of cpg1.5.36 and later.
Logged
Pages: [1]   Go Up
 

Page created in 0.065 seconds with 19 queries.