Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 333413 - dev-php5/pecl-imagick-3.0.0: issue in Imagick::readImage class for pdf input documents
Summary: dev-php5/pecl-imagick-3.0.0: issue in Imagick::readImage class for pdf input ...
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: PHP Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-19 10:05 UTC by Marco Clocchiatti
Modified: 2011-05-23 19:36 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge.info,5.56 KB, text/plain)
2010-08-19 10:07 UTC, Marco Clocchiatti
Details
autounmask log (autounmask_dev-php5-pecl-imagick-3.0.1-r1.log,28.15 KB, text/plain)
2010-12-28 08:50 UTC, Marco Clocchiatti
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marco Clocchiatti 2010-08-19 10:05:09 UTC
$im->readImage( 'filename.pdf[3]' );
seems unbale to open file.
ImagickException thrown

I'm using:
www-servers/apache-2.2.15
dev-lang/php-5.3.3-r1
dev-php5/pecl-imagick-3.0.0
media-gfx/imagemagick-6.6.3.0
media-libs/pdflib-7.0.4_p4-r1
dev-php5/pecl-pdflib-2.1.5
app-text/ghostscript-gpl-8.71-r6

just tested all possible downgrades with non luck.


Reproducible: Always

Steps to Reproduce:
1.prepare a .php such as this:
<?php

$image = new Imagick( '' );
$image->readImage( 'test.pdf[2]' );
$image->setImageFormat("png");

//header('Content-type: image/png');
echo $image;

?>

2. test the code via http.


Actual Results:  
3. read this error on browser or on apache logs:

Fatal error: Uncaught exception 'ImagickException' with message 'unable to open image `test.pdf': @ error/blob.c/OpenBlob/2514' in /var/www/localhost/htdocs/nuovaAgenzia/img.php:4 Stack trace: #0 /var/www/localhost/htdocs/nuovaAgenzia/img.php(4): Imagick->readimage('test.pdf[2]') #1 {main} thrown in /var/www/localhost/htdocs/nuovaAgenzia/img.php on line 4

changing test.pdf[2] > test.pdf, the last page of pdf is loaded, instead of the first one.

Expected Results:  
should be loaded the pdf page indicated in [n].
Comment 1 Marco Clocchiatti 2010-08-19 10:07:00 UTC
Created attachment 243545 [details]
emerge --info
Comment 2 Marco Clocchiatti 2010-09-01 06:43:41 UTC
summer was changed, specifing pecl-image version.

but I've the same problem in pecl-image-2.3.0.

the only difference to reproduce it is in sintax of php file:

<?php

$image = new Imagick( 'test.pdf' );
//$image->readImage( 'test.pdf' );
$image->setImageFormat('png');

header('Content-type: image/png');
echo $image;

?>

The problem arised from me after some ugrade of other software, but now I'm unable to dowgrade system at a working setup.
Comment 3 Matti Bickel (RETIRED) gentoo-dev 2010-10-17 20:16:08 UTC
Hmm, can't reproduce.

Using:
http://www.scherbaum.info/~tobias/talks/2007-05-19-Die-Gentoo-Metadistribution.pdf moved to test.pdf in the directory i pasted your testscript in.

Setup:
amd64
php-5.3.3-r1
pecl-imagick-3.0.0
imagemagick-6.6.2.5 (6.6.3 is not stable)
pdflib-7.0.2_p8 (not using pecl-pdflib here)
ghostscript-gpl-8.71-r1

I was also able to use bracket notation on __construct('test.pdf[1]') to get the second page of the presentation.

Is this still an issue for you?
Comment 4 Marco Clocchiatti 2010-10-18 09:41:59 UTC
(In reply to comment #3)
> Hmm, can't reproduce.
>
> 
> Is this still an issue for you?
> 

sorry. I can't test on this week.
if you are wright, I'll mark fixed this bug as invalid by myself.
thank.
Comment 5 Marco Clocchiatti 2010-11-11 00:44:18 UTC
I don't understand.
I'm fighting against my issue, but I'm not able to change bad behaviour.

What can I do to discover some unstability in my system?

now, I've uninstalled pecl-pdflib and I've dowgraded all my software to your versions, without luky.
Comment 6 Ole Markus With (RETIRED) gentoo-dev 2010-12-27 22:50:04 UTC
I cannot reproduce this with pecl-imagick-3.0.1-r1. Have you tried upgrading to the latest versions the packages you mentioned?
Comment 7 Marco Clocchiatti 2010-12-28 08:50:58 UTC
Created attachment 258243 [details]
autounmask log

(In reply to comment #6)
> I cannot reproduce this with pecl-imagick-3.0.1-r1. Have you tried upgrading to
> the latest versions the packages you mentioned?
> 
this gives me a new problem:
unmasking pecl-imagick-3.0.1-r1, arise a conflict beteween dev-lang/php-5.3.4 and media-libs/ming-0.4.3

should I open a new bug?
Comment 8 Ole Markus With (RETIRED) gentoo-dev 2010-12-28 10:30:36 UTC
(In reply to comment #7)
> Created an attachment (id=258243) [details]
> autounmask log
> 
> (In reply to comment #6)
> > I cannot reproduce this with pecl-imagick-3.0.1-r1. Have you tried upgrading to
> > the latest versions the packages you mentioned?
> > 
> this gives me a new problem:
> unmasking pecl-imagick-3.0.1-r1, arise a conflict beteween dev-lang/php-5.3.4
> and media-libs/ming-0.4.3
> 
> should I open a new bug?
> 

Yes. Open a new bug and say that the php-ext-source-r1 eclass must be removed from the ming ebuild. Ming doesn't even support the php useflag anymore, as far as I can see.
Comment 9 Marco Clocchiatti 2010-12-28 16:15:06 UTC
done.

http://bugs.gentoo.org/show_bug.cgi?id=349969
Comment 10 Marco Clocchiatti 2010-12-28 22:56:13 UTC
shit.

running strace over http command, I found that Imagick imagick was searching 'test.pdf' in a absolute path, instead of a relative one.

putting in the absolute path, php command runs fine.

is this a correct behaviour for the command, or depends from such parameter in my apache or php configuration?

thanks for patience.
Comment 11 Ole Markus With (RETIRED) gentoo-dev 2011-01-03 10:19:29 UTC
I tested with a relative path and that worked well. I am not aware of any configuration option that affects this behaviour. If you suspect it has something to do with a configuration param, I recommend you test with the default configs.
Comment 12 Matti Bickel (RETIRED) gentoo-dev 2011-01-24 00:10:48 UTC
Having a look at the source, the extension converts your relative path to an absolute one and checks if it can read/write that one (compare imagick_read.c:191). Maybe this is what you're seeing with strace.

Just to clarify: does latest pecl-imagick work for you as expected now?
Comment 13 Ole Markus With (RETIRED) gentoo-dev 2011-05-23 17:05:22 UTC
Been a few months without any answers. Guess it works then.
Comment 14 Marco Clocchiatti 2011-05-23 19:36:43 UTC
(In reply to comment #13)
> Been a few months without any answers. Guess it works then.

sorry. I'm not working here.
if you like, close the bug.

if needed, may it be I'll came back later.