Req->Doc #61583 [Asn]: Imagick extension does not work with relative paths

From: Date: Tue, 01 Mar 2016 22:32:28 +0000
Subject: Req->Doc #61583 [Asn]: Imagick extension does not work with relative paths
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-13227@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=61583&edit=1 ID: 61583 Updated by: danack@php.net Reported by: filip dot karas at gmail dot com Summary: Imagick extension does not work with relative paths Status: Assigned -Type: Feature/Change Request +Type: Documentation Problem Package: imagick Operating System: Windows 7 PHP Version: 5.4.0 Assigned To: danack Block user comment: N Private report: N New Comment: After having thought about this for a while - I'm not going to attempt to change it. It is trivial to call realpath in userland, and pass absolute file names to Imagick. Trying to handle things like "./SQTimetable.pdf[2]" which means open the 2nd page of the PDF as valid "file names" is absolutely not trivial - in fact I'm not sure how it could be handled. Rather than creating a whole load of work, just to solve something that already has a userland solution, I'm just going to update the documentation to be clearer that only absolute file names are supported. Previous Comments: ------------------------------------------------------------------------ [2016-02-16 05:00:33] minhtho2611 at gmail dot com Uncaught exception 'ImagickException' with message 'UnableToLoadModule `C:\xampp\apache\bin\IM_MOD_RL_TIFF_.dll': The specified procedure could not be found. @ error/module.c/OpenModule/1282' in D:\MinhTho\SNG\08_Sourcecode\PHP\admin\application\controllers\image.php:300 Stack trace: #0 i want setting image tiff in xampp windows.thank you. ------------------------------------------------------------------------ [2016-02-08 13:41:44] danack@php.net Lee, if you are seeing an issue with utf8 chars, please open a separate issue. What you are seeing is very unlikely to be related to this one. ------------------------------------------------------------------------ [2016-02-07 18:12:24] lee dot traynor at skeptic dot de Realpath () returns an ordinary ANSI/ISO string but Imagick requires this to be in UTF-8, so if there are any unusual characters in the path, this has to be converted first: $im = new Imagick (utf8_encode (realpath ("some_file.jpg"))); ------------------------------------------------------------------------ [2015-12-18 14:01:01] danack@php.net There isn't going to be a perfect solution. Imagick can pass things that are not valid filenames to ImageMagick, and this greatly confuses the PHP virtual directory. For example new Imagick("foo.pdf[2]") would load the 3rd page of a PDF as a single image, but it is not a valid filename. ------------------------------------------------------------------------ [2015-04-01 17:20:19] danack@php.net Assigning to myself to investigate. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=61583 -- Edit this bug report at https://bugs.php.net/bug.php?id=61583&edit=1

« previous php.doc.bugs (#13227) next »