CPG loads fullsize instead of normal on some images CPG loads fullsize instead of normal on some images
 

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]

Main Menu

CPG loads fullsize instead of normal on some images

Started by nickelas, February 18, 2013, 05:26:26 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

nickelas

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
Human

phill104

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.
It is a mistake to think you can solve any major problems just with potatoes.

Veronica

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

Niecher

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.

nickelas

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
Human

Veronica

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

phill104

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.
It is a mistake to think you can solve any major problems just with potatoes.

Αndré

Quote from: nickelas on February 18, 2013, 07:16:47 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.

nickelas

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.
Human

phill104

Quote from: Phill Luckhurst on February 18, 2013, 05:41:40 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
It is a mistake to think you can solve any major problems just with potatoes.

Αndré

Quote from: Phill Luckhurst on February 21, 2013, 01:40:16 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:
Quote from: nickelas on February 18, 2013, 07:16:47 PM
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.

Αndré

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

nickelas

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?
Human

Αndré

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

nickelas

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
Human

Αndré

Quote from: nickelas on February 25, 2013, 04:37:41 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.


Quote from: nickelas on February 25, 2013, 04:37:41 PM
this issue is solved
Then please
Quote from: Joachim Müller on September 28, 2008, 12:46:26 PM
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.