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: CPG loads fullsize instead of normal on some images  (Read 7437 times)

0 Members and 1 Guest are viewing this topic.

nickelas

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 114
CPG loads fullsize instead of normal on some images
« on: February 18, 2013, 05:26:26 pm »

I stumbled upon a strange error where CPG tries to load the fullsize image instead of the normal. An example can be seen at:
http://uppsalafoto.se/galleri/displayimage.php?pid=3843
(Since fullsize is not allowed, no image is displayed)

It seems like it has something to do with the filename of the jpg that contains ~

Any advice or pointers appreciated!
http://uppsalafoto.se/galleri/
Cheers
Logged
Human

phill104

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4859
    • Windsurf.me
Re: CPG loads fullsize instead of normal on some images
« Reply #1 on: February 18, 2013, 05:41:40 pm »

I am guessing here that your images may be of a size less than the size you have set for your intermediate image. If that is the case then coppermine does not create an intermediate sized image and therefore if you then block the access to the fullsize images there is nothing for coppermine to display.

Maybe we need to add a check to see if an  intermediate image is available then if not and that if fullsize is blocked to display the thumb instead.
Logged
It is a mistake to think you can solve any major problems just with potatoes.

Veronica

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: se
  • Offline Offline
  • Posts: 106
  • Coppermine 1.5.22
Re: CPG loads fullsize instead of normal on some images
« Reply #2 on: February 18, 2013, 06:35:20 pm »

Coppermine is trying to load this image name ... userpics/_DSC0048%7E0.jpg which does not exist
which you can see with FireFox/PageInfo/Media
Logged

Niecher

  • LocalSupporter
  • Coppermine frequent poster
  • ***
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 191
Re: CPG loads fullsize instead of normal on some images
« Reply #3 on: February 18, 2013, 07:08:21 pm »

Phill Luckhurst gave the correct answer.

This gallery is using the mod fullsize_access and all files are protected with 0660.

The intermediate image is as large as the original image.
Logged

nickelas

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 114
Re: CPG loads fullsize instead of normal on some images
« Reply #4 on: February 18, 2013, 07:16:47 pm »

Thanks,
In the past the size of the normal picture was changed to a bigger one and all regenerated. But appears like some files (containing strange characters?) might have been omitted. And I guess CPG has some code that chooses the fullsize instead of the normal one, if the size of the normal one is too small
Logged
Human

Veronica

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: se
  • Offline Offline
  • Posts: 106
  • Coppermine 1.5.22
Re: CPG loads fullsize instead of normal on some images
« Reply #5 on: February 18, 2013, 08:56:20 pm »

Yes this indicates that there are some missing urldecode calls probably giving errors in cpg_getimagesize.
Logged

phill104

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4859
    • Windsurf.me
Re: CPG loads fullsize instead of normal on some images
« Reply #6 on: February 18, 2013, 08:59:58 pm »

Indeed, so can we please start a new topic to discuss that. This one is marked as solved by the user and as such would probably be missed. This is one reason we have the one topic per thread rule.
Logged
It is a mistake to think you can solve any major problems just with potatoes.

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15765
Re: CPG loads fullsize instead of normal on some images
« Reply #7 on: February 19, 2013, 05:12:20 pm »

I guess CPG has some code that chooses the fullsize instead of the normal one, if the size of the normal one is too small
Actually that's not the case. Coppermine checks the picture dimension values which are stored in the database and then decides according to your settings if it displays the intermediate-sized picture (normal_filename.jpg) or the full-sized picture (filename.jpg).

IMHO this topic is not solved regarding the subject, as the full-sized picture is still used in the example link. It seems that you disabled the fullsize_access plugin to (temporary) fix your issue?


Marking thread as not solved.
Logged

nickelas

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 114
Re: CPG loads fullsize instead of normal on some images
« Reply #8 on: February 21, 2013, 12:28:42 pm »

Ok, let me know if you need any info. The link is working at the moment because I downloaded the fullsize and uploaded it again using the replace plugin (so fullsize not secured yet). Thought that might cause CPG to start using the normal but it did not. I think a thumbnail was generated but not the normal picture.
Logged
Human

phill104

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4859
    • Windsurf.me
Re: Re: CPG loads fullsize instead of normal on some images
« Reply #9 on: February 21, 2013, 01:40:16 pm »


Maybe we need to add a check to see if an  intermediate image is available then if not and that if fullsize is blocked to display the thumb instead.

Do you think this suggestion would work Andre? We should only display the thumb on the intermediate view if the fullsize cannot be accessed
Logged
It is a mistake to think you can solve any major problems just with potatoes.

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15765
Re: CPG loads fullsize instead of normal on some images
« Reply #10 on: February 21, 2013, 01:50:42 pm »

Do you think this suggestion would work Andre? We should only display the thumb on the intermediate view if the fullsize cannot be accessed
This issue should be handled by the plugin IMHO. Coppermine works exactly that way: it just creates intermediate-sized pictures if the full-sized picture dimensions exceeds the intermediate-sized picture limits set in the config. This saves some disk space at we don't need to store dupes and works without any issue on stock Coppermine galleries.

So either the plugin needs to check the picture dimensions before adjusting permissions on file system level (recommended) or it adds exactly the approach you already suggested (should also be possible with a plugin hook).


Regarding the Coppermine core code I'd like to investigate:
In the past the size of the normal picture was changed to a bigger one and all regenerated. But appears like some files (containing strange characters?) might have been omitted.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15765
Re: CPG loads fullsize instead of normal on some images
« Reply #11 on: February 21, 2013, 03:46:18 pm »

nikelas, please post some/all links to the intermediate-sized views of pictures where the issue occur.
Logged

nickelas

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 114
Re: CPG loads fullsize instead of normal on some images
« Reply #12 on: February 23, 2013, 12:50:15 pm »

Ok I will get back with some links.
It seems if I upload an image in 300 ppi sized to 600 px CPG does not generate an intermediate picture. So CPG does not take ppi into account, maybe it should?
Logged
Human

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15765
Re: CPG loads fullsize instead of normal on some images
« Reply #13 on: February 23, 2013, 07:26:31 pm »

What are your intermediate-sized picture settings? When should it be created?
Logged

nickelas

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 114
Re: CPG loads fullsize instead of normal on some images
« Reply #14 on: February 25, 2013, 04:37:41 pm »

It seems my theory about files containing unusual letters causing intermediate picture to not be generated was wrong. Some very old files were in the size 600 px (fullsize) and when a change was done setting intermediate size to 690 px, the fullsize was used instead.
Only question I have is more out of curiosity - An image sized 600 px at 300 ppi should be enough to generate a 690 px at 72 ppi, right?
Anyways for me this issue is solved as I understand what is causing the trouble, thanks
Logged
Human

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15765
Re: CPG loads fullsize instead of normal on some images
« Reply #15 on: February 25, 2013, 04:59:46 pm »

An image sized 600 px at 300 ppi should be enough to generate a 690 px at 72 ppi, right?
I don't think so, as a pixel is always a pixel.


this issue is solved
Then please
tag your answer as "solved" by clicking on the "Topic Solved" button on the bar at the left hand side at the bottom of your thread.
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 20 queries.