forum.coppermine-gallery.net
Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: Niecher on February 21, 2013, 01:07:43 pm
-
The plugin "replace" all it does is replace the image, but does not change the information dimensions and file size.
You must do this manually in administrative tools.
Then you update everything (full-sized, resized and thumbs) for that album, as there is no option to update a single image.
Possibly, the intermediate image is not updated because it does not exist, since it was never established at the time of upload. Perhaps it may be that is created at this time to update everything (no I can assure you, you should try it).
Likewise, this plugin does not change file extensions if the new file has another extension, even if the same image.
-
Niecher, do you talk about the file_replacer plugin? It actually updates the picture dimensions and file size in the database.
-
I must rectify, because I just did a test
The dimensions are changed, but the file size is not. Then you need to use the administrative tools to change the file size in the database.
At least this happens to me and I am using the version (file_replacer): v1.6
-
The dimensions are changed, but the file size is not.
Strange, as the code tells something different:
$image_filesize = filesize($image);
$total_filesize = is_image($filename) ? ($image_filesize + (file_exists($normal) ? filesize($normal) : 0) + filesize($thumb)) : ($image_filesize);
cpg_db_query("UPDATE {$CONFIG['TABLE_PICTURES']} SET filesize = '$image_filesize', total_filesize = '$total_filesize', pwidth = '$width', pheight = '$height' WHERE pid = '$pid' LIMIT 1");
-
Yes, I see the code in the file codebase.php
But if I replace a file with another file smaller or larger and run in admin tools > reload file dimensions and size information, is always telling me:
for example:
Total filesize is incorrect
Database: 97,830 bytes
Now: 160 794 bytes
updated
This is what happens in my case.
-
The only difference in the admin tools and plugin code is, that the plugin checks is the current file is an image. Can you please post some more detailed information, or even attach an "old" and "new" test file where the issue occurs in your gallery?
I think I'll split the discussion regarding the plugin later.
-
I have thought that if the plugin behaves the same way on nickelas gallery
and as he said he had upload a new file using the plugin replace
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.
and this new file is the original fullsize and larger than the previous file exists, then, for this reason I think he should update the file size in the database
using admin tools > reload file dimensions and size information
and thereupon to do this in admin tools > Update thumbs and / or resized photos > Everything: full-sized, resized and thumbs
and possibly all pictures are regenerated again, including intermediate image
or perhaps the intermediate image is not regenerated, because, was never established at the time of the upload.
This is something he should try and tell us all.
Sorry for the English, but I use google.
-
or perhaps the intermediate image is not regenerated, because, was never established at the time of the upload.
It would not be regenerated if the original image size it smaller than the settings applied for the intermediate image.
-
Niecher, if the file_replacer plugin doesn't work as expected, fine. But it doesn't matter which value is stored for the file size in the database, as it's not used to determine if an intermediate-sized picture needs to be created or displayed. The plugin also doesn't care if there has already been an intermediate-sized picture, as it always creates it (if needed) while overwriting any prior version. There's no check for already existing files.
Regarding the plugin, please
post some more detailed information, or even attach an "old" and "new" test file where the issue occurs in your gallery
-
Splitted from CPG loads fullsize instead of normal on some images (http://forum.coppermine-gallery.net/index.php/topic,76009.0.html).
-
I tried the plugin replace with different images, then:
The gallery generates the intermediate image properly or does not generate the intermediate image, as we all know, if the full size image is smaller than the intermediate size image.
Well, it does not replace the 'file_replacer plugin' is:
Filename
File Extension
File size in the database.
To update the file size in the database is necessary to do so in admin tools .
As I said before, for example:
Total filesize is incorrect
Database: 97.830 bytes
Now: 160 794 bytes
updated
Regarding the plugin, please
post some more detailed information, or even attach an "old" and "new" test file where the issue occurs in your gallery
All files are OK, except the replaced file. See the attachment.
-
Has the jpg quality level changed?
-
is the same for JPG and PNG files, the file size in the database is always updated in admin tools, and not by the plugin.
The quality of JPEG files is set to 100%
-
Open codebase.php, find
$total_filesize = is_image($filename) ? ($image_filesize + (file_exists($normal) ? filesize($normal) : 0) + filesize($thumb)) : ($image_filesize);
and replace with
$total_filesize = is_image($row['filename']) ? ($image_filesize + (file_exists($normal) ? filesize($normal) : 0) + filesize($thumb)) : ($image_filesize);
Please report if it works as expected.
-
Yes André, this new code works perfectly.
Thank you very much.
Has the jpg quality level changed?
Thank you too Phil, after your question, I replaced the jpeg quality level from 100 to 80 (default)
Do not see the difference in quality.
I update thumbsnails and intermediate images.
Obviously it reduced the size of these images, and the PageSpeed increased from 77 to 92.
-
Marking as solved. Will commit the change soon and also maybe release a new plugin version.
-
You can download the new plugin version 1.7 here (http://forum.coppermine-gallery.net/index.php/topic,60499.0.html).