Problem resizing or creating thumbnails - Page 2 Problem resizing or creating thumbnails - Page 2
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Problem resizing or creating thumbnails

Started by flapane, June 08, 2012, 12:34:55 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

flapane

They keep saying that the error is related to line 71 and not to Imagemagik.
I don't understand how they found something wrong with line 71, if cpg clearly states that the problem is on line 699.
Flapane
www.flapane.com

Gallery
www.gallery.flapane.com

Αndré

Quote from: flapane on June 20, 2012, 06:02:39 PM
I don't understand how they found something wrong with line 71
I assume they just put that URL into their browser: http://www.flapane.com/gallery/db_input.php and of course get the following error message
QuoteCritical error
Script called without the required parameter(s).

File: /home/flapanec/public_html/gallery/db_input.php - Line: 71

.......  :o ::)

flapane

oh my...
They didn't even bother reading what I wrote.
Flapane
www.flapane.com

Gallery
www.gallery.flapane.com

flapane

They told me another time that they don't have any problems and I'd better contact cpg developer (as if I hadn't already told them what we wrote in this thread...).
"Disappointed" is the right word, I guess. I may consider migrating elsewhere when the annual subscription expires.
Flapane
www.flapane.com

Gallery
www.gallery.flapane.com

flapane

I've also just tried reinstalling 1.5.20 on the top of itself and disabling the plugins. Needless to say, nothing changed (after all, the problem first appeared all of a sudden without any changing to the code, so reinstalling cpg couldn't have helped).
Flapane
www.flapane.com

Gallery
www.gallery.flapane.com

Αndré

Maybe a test with a different software that also uses ImageMagick will approve our assumption that there's something wrong with ImageMagick on your hosts part. But I don't know such a software.

flapane

That's a good idea. I'll keep you updated in case I found some PHP script which uses IM.
Flapane
www.flapane.com

Gallery
www.gallery.flapane.com

flapane

This code succesfully created a thumbnail:

<?php
 
/*
A simple example demonstrate thumbnail creation.
*/ 
 
/* Create the Imagick object */
$im = new Imagick();
 
/* Read the image file */
$im->readImage'test.jpg' );
 
/* Thumbnail the image ( width 100, preserve dimensions ) */
$im->thumbnailImage100null );
 
/* Write the thumbail to disk */
$im->writeImage'th_test.jpg' );
 
/* Free resources associated to the Imagick object */
$im->destroy();
 
?>

Flapane
www.flapane.com

Gallery
www.gallery.flapane.com

Αndré


flapane

QuotePHP.net: IMagick is a native PHP extension to create and modify images using the ImageMagick API.
Provides a wrapper to the ImageMagick library.

should I try a different php script?
Flapane
www.flapane.com

Gallery
www.gallery.flapane.com

Joe Carver

What do you have for the setting in Config >> File settings   >> Additional command line options for ImageMagick  ?
Could the value have been corrupted in the db?

Please attach a screenshot of that setting.

flapane

Yep, one of the first thing I did was deleting every additional CLI setting (which has been -antialias -unsharp 0.7x0.5+0.7+0.008 for the last couple of years or so) from that textfield, but nothing changed.
I wonder if the setting still remained in the sql dbase and eventually corrupted. Do I have to search for a specific sql db field in order to check this?
Thanks
Flapane
www.flapane.com

Gallery
www.gallery.flapane.com

Αndré

Quote from: flapane on June 24, 2012, 01:00:21 PM
Do I have to search for a specific sql db field in order to check this?
That setting is stored in the config table. Search for the row with the name "im_options".

flapane

It looks empty as it should be
Flapane
www.flapane.com

Gallery
www.gallery.flapane.com

Αndré

As GD2 works as expected, isn't that thread already solved? I just wanted to debug $output and $retval in your gallery, but unfortunately it seems that my FTP account to your gallery doesn't exist anymore. Of course IM must be chosen in the config if you want me to debug that values. Maybe it brings some light into the darkness.

flapane

FTP account was temporary disabled for security reasons, please try again.
Maybe the title should be changed to "IM: Problem resizing or creating thumbnails", because the control granted to the user by IM command line options is vital.
The weird things are that it stopped working all of a sudden a couple of weeks ago, and IM *seems* to work using a test script, and that reinstalling cpg on top of itself didn't solve.
Thanks
Flapane
www.flapane.com

Gallery
www.gallery.flapane.com

Αndré

#36
PHP tries to execute the following command:
Quote/usr/bin/convert -quality 80 -geometry 100x74 -unsharp 0.5x0.707106781187+1.2+0.03

As you can see, both the source and destination file strings are missing. The reason is the function escapeshellarg:
Quoteif (preg_match("#[A-Z]:|\\\\#Ai", __FILE__)) {
                // get the basedir, remove '/include'
                $cur_dir = substr(dirname(__FILE__), 0, -8);
                $src_file = '"' . $cur_dir . '\\' . strtr($src_file, '/', '\\') . '"';
                $im_dest_file = str_replace('%', '%%', ('"' . $cur_dir . '\\' . strtr($dest_file, '/', '\\') . '"'));
            } else {
                $src_file = escapeshellarg($src_file);
                $im_dest_file = str_replace('%', '%%', escapeshellarg($dest_file));
            }

For some reason that function returns empty strings. Please ask your host about that function. Here's a test script and its output:
$test = "test";
var_dump($test);
echo "\n";
var_dump(escapeshellarg($test));

Quotestring(4) "test"
NULL

flapane

Thanks, I'm gonna write them another message.
Flapane
www.flapane.com

Gallery
www.gallery.flapane.com

flapane

They said that escapeshellarg() has always been disabled because of security reasons, so probably I never noticed the problem because Coppermine started using on the latest release only.
---

I wonder if it's actually been introduced in 1.5.20 only.
Flapane
www.flapane.com

Gallery
www.gallery.flapane.com

Αndré

I don't know when it has been introduced, but it hasn't been introduced recently, as it's also been used in cpg1.4.x.