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 [2] 3   Go Down

Author Topic: Problem resizing or creating thumbnails  (Read 177172 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
Re: Problem resizing or creating thumbnails
« Reply #20 on: June 20, 2012, 06:02:39 pm »

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.

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Re: Problem resizing or creating thumbnails
« Reply #21 on: June 21, 2012, 12:35:32 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
Quote
Critical error
Script called without the required parameter(s).

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

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

flapane

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 251
    • Flavio's page
Re: Problem resizing or creating thumbnails
« Reply #22 on: June 21, 2012, 12:55:23 pm »

oh my...
They didn't even bother reading what I wrote.

flapane

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 251
    • Flavio's page
Re: Problem resizing or creating thumbnails
« Reply #23 on: June 21, 2012, 03:01:50 pm »

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

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 251
    • Flavio's page
Re: Problem resizing or creating thumbnails
« Reply #24 on: June 22, 2012, 11:09:17 pm »

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

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Re: Problem resizing or creating thumbnails
« Reply #25 on: June 23, 2012, 10:52:40 am »

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

flapane

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 251
    • Flavio's page
Re: Problem resizing or creating thumbnails
« Reply #26 on: June 23, 2012, 03:15:43 pm »

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

flapane

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 251
    • Flavio's page
Re: Problem resizing or creating thumbnails
« Reply #27 on: June 23, 2012, 05:58:13 pm »

This code succesfully created a thumbnail:
Code: [Select]
<?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();
 
?>

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Re: Problem resizing or creating thumbnails
« Reply #28 on: June 23, 2012, 10:02:16 pm »

But Imagick isn't ImageMagick, right?
Logged

flapane

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 251
    • Flavio's page
Re: Problem resizing or creating thumbnails
« Reply #29 on: June 23, 2012, 10:10:35 pm »

Quote
PHP.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?

Joe Carver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1504
  • aka 'i-imagine'
    • Home Page
Re: Problem resizing or creating thumbnails
« Reply #30 on: June 24, 2012, 12:49:19 pm »

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

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 251
    • Flavio's page
Re: Problem resizing or creating thumbnails
« Reply #31 on: June 24, 2012, 01:00:21 pm »

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

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Re: Problem resizing or creating thumbnails
« Reply #32 on: June 25, 2012, 09:26:46 am »

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".
Logged

flapane

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 251
    • Flavio's page
Re: Problem resizing or creating thumbnails
« Reply #33 on: June 25, 2012, 10:42:20 am »

It looks empty as it should be

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Re: Problem resizing or creating thumbnails
« Reply #34 on: June 25, 2012, 11:30:07 am »

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

flapane

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 251
    • Flavio's page
Re: Problem resizing or creating thumbnails
« Reply #35 on: June 25, 2012, 11:40:18 am »

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

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Re: Problem resizing or creating thumbnails
« Reply #36 on: June 25, 2012, 12:33:18 pm »

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:
Quote
            if (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:
Code: [Select]
$test = "test";
var_dump($test);
echo "\n";
var_dump(escapeshellarg($test));
Quote
string(4) "test"
NULL
« Last Edit: June 25, 2012, 01:06:37 pm by Αndré »
Logged

flapane

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 251
    • Flavio's page
Re: Problem resizing or creating thumbnails
« Reply #37 on: June 25, 2012, 12:35:12 pm »

Thanks, I'm gonna write them another message.

flapane

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 251
    • Flavio's page
Re: Problem resizing or creating thumbnails
« Reply #38 on: June 26, 2012, 10:34:29 am »

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.

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Re: Problem resizing or creating thumbnails
« Reply #39 on: June 26, 2012, 11:28:06 am »

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.
Logged
Pages: 1 [2] 3   Go Up
 

Page created in 0.023 seconds with 20 queries.