Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

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

0 Members and 1 Guest are viewing this topic.

flapane

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 251
    • Flavio's page
Empty spaces inside photo's description textfield.
« on: January 01, 2015, 04: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: 15764
Re: Empty spaces inside photo's description textfield.
« Reply #1 on: January 01, 2015, 08: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: de
  • Offline Offline
  • Gender: Male
  • Posts: 251
    • Flavio's page
Re: Empty spaces inside photo's description textfield.
« Reply #2 on: January 01, 2015, 10: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, 10:13:05 pm by flapane »
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Empty spaces inside photo's description textfield.
« Reply #3 on: January 01, 2015, 10: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: de
  • Offline Offline
  • Gender: Male
  • Posts: 251
    • Flavio's page
Re: Empty spaces inside photo's description textfield.
« Reply #4 on: January 03, 2015, 10: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: 15764
Re: Empty spaces inside photo's description textfield.
« Reply #5 on: January 08, 2015, 10: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.019 seconds with 19 queries.