Announcement

#1 2014-05-13 12:23:18

LDS
Guest

Imagick exception - blob file not found when uploading image

Hello/Hi/Greetings,

After many attempts, I was able to install ImageMagick as a PHP extension. But when I upload files with ImageMagick enabled (everything works if I use GD), I get this error:

----
Php[120820], PHP Fatal error:  Uncaught exception 'ImagickException' with message 'UnableToOpenBlob `././upload/2014/05/12/20140512195316-654db6d1.jpg': No such file or directory @ error/blob.c/OpenBlob/2642' in C:\webroot\piwigo\admin\include\image.class.php:416
Stack trace:
#0 C:\webroot\piwigo\admin\include\image.class.php(416): Imagick->__construct('././upload/2014...')
#1 C:\webroot\piwigo\admin\include\image.class.php(87): image_imagick->__construct('././upload/2014...')
#2 C:\webroot\piwigo\i.php(531): pwg_image->__construct('././upload/2014...')
#3 {main}
  thrown in C:\webroot\piwigo\admin\include\image.class.php on line
---

The '././' prepended to the file path looks suspicious to me - shouldn't it be "../../" or something alike?

Piwigo version: 2.6.2
PHP version:  5.4.28
MySQL version: 5.0.37
Piwigo URL: http://www.sandon.it/photo

 

#2 2014-05-13 14:42:46

flop25
Piwigo Team
2006-07-06
7037

Re: Imagick exception - blob file not found when uploading image

hello
what's the IM version? could you update it?


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#3 2014-05-13 20:33:51

LDS
Guest

Re: Imagick exception - blob file not found when uploading image

php_imagick.dll is version 5.4.20.0, downloaded from http://pecl.php.net/package/imagick/3.1.2/windows, latest stable TS version for PHP 5.4 (I'm running Apache 2.2.26 on Windows, via php5_module).

Dependencies were downloaded from http://windows.php.net/downloads/pecl/d … c9-x86.zip

I don't know if I can upgrade it to ImageMagick-6.8.9-1 because it looks they are compiled with VC10 and I'm afraid they can be not compatible.

I tried before to run ImageMagick-6.8.9-1 as "external", but there was no way to make Piwigo "see" it.

From php_info():


imagick module

enabled

imagick module version  3.1.2 
imagick classes  Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator 
ImageMagick version  ImageMagick 6.8.8-4 Q16 x86 2014-01-29 http://www.imagemagick.org 
ImageMagick copyright  Copyright (C) 1999-2014 ImageMagick Studio LLC 
ImageMagick release date  2014-01-29 
ImageMagick number of supported formats:  225 
ImageMagick supported formats  3FR, A, AAI, AI, ART, ARW, AVI, AVS, B, BGR, BGRA, BIE, BMP, BMP2, BMP3, BRF, C, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CLIPBOARD, CMYK, CMYKA, CR2, CRW, CUR, CUT, DCM, DCR, DCX, DDS, DFONT, DJVU, DNG, DOT, DPS, DPX, DXT1, DXT5, EMF, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, EXR, FAX, FITS, FPX, FRACTAL, FTS, G, G3, GIF, GIF87, GRADIENT, GRAY, GROUP4, GV, HALD, HDR, HISTOGRAM, HRZ, HTM, HTML, ICB, ICO, ICON, INFO, INLINE, IPL, ISOBRL, J2K, JBG, JBIG, JNG, JNX, JP2, JPC, JPEG, JPG, JPT, JSON, K, K25, KDC, LABEL, M, M2V, M4V, MAC, MAP, MASK, MAT, MATTE, MEF, MIFF, MNG, MONO, MOV, MP4, MPC, MPEG, MPG, MRW, MSL, MSVG, MTV, MVG, NEF, NRW, NULL, O, ORF, OTB, OTF, PAL, PALM, PAM, PANGO, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG00, PNG24, PNG32, PNG48, PNG64, PNG8, PNM, PPM, PREVIEW, PS, PS2, PS3, PSB, PSD, PTIF, PWP, R, RADIAL-GRADIENT, RAF, RAS, RGB, RGBA, RGBO, RGF, RLA, RLE, RW2, SCR, SCT, SFW, SGI, SHTML, SPARSE-COLOR, SR2, SRF, STEGANO, SUN, SVG, SVGZ, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TTC, TTF, TXT, UBRL, UIL, UYVY, VDA, VICAR, VID, VIFF, VST, WBMP, WEBP, WMF, WMV, WPG, X3F, XBM, XC, XCF, XPM, XPS, XV, Y, YCbCr, YCbCrA, YUV 

Directive Local Value Master Value

imagick.locale_fix 0 0
imagick.progress_monitor 0 0


Also, I was running before Menalto Gallery 2 with ImageMagick and had no problem. Now I'm trying to switch to Piwigo but it looks ImageMagick support is somewhat not yet ready, especially in Windows.

 

#4 2014-05-13 21:01:47

flop25
Piwigo Team
2006-07-06
7037

Re: Imagick exception - blob file not found when uploading image

It does That should come from your environment


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#5 2014-05-14 16:15:26

LDS
Guest

Re: Imagick exception - blob file not found when uploading image

I didn't understand your answer. Do you mean there's something wrong with my environment setup? It looks to me it's Piwigo building the wrong path...

 

#6 2014-05-14 16:52:26

flop25
Piwigo Team
2006-07-06
7037

Re: Imagick exception - blob file not found when uploading image

I have notified someone more competent about that

I see the path, but since you have an 'orphelin' bug it should comes from a specifity of your env misleading Piwigo or directly from your env


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#7 2014-05-15 10:18:28

LDS
Guest

Re: Imagick exception - blob file not found when uploading image

Thank you. If there is anything I could do to help let me know. If there are configurations changes in Apache or PHP I can try I can do it.

 

#8 2014-06-17 21:51:55

LDS
Guest

Re: Imagick exception - blob file not found when uploading image

Ok, I did some more tries:

Upgraded server Windows 2003 -> Windows 2008R2
Upgraded MySQL 5.0.x -> 5.6.19
Upgraded Apache 2.2.x -> 2.4.9
Upgraded PHP 5.4.x -> 5.5.13
Upgraded Piwigo 2.6.2 -> 2.6.3

Environment
•Operating system: WINNT
•PHP: 5.5.13 (Show info) [2014-06-17 21:43:41]
•MySQL: 5.6.19-log [2014-06-17 21:43:41]
•Graphics Library: ImageMagick 6.8.9-1

Same issue:


php[1760]
PHP Fatal error:  Uncaught exception 'ImagickException' with message 'UnableToOpenBlob `././upload/2014/06/17/20140617213706-df0a7174.jpg': No such file or directory @ error/blob.c/OpenBlob/2657' in C:\webroot\piwigo\admin\include\image.class.php:416
Stack trace:
#0 C:\webroot\piwigo\admin\include\image.class.php(416): Imagick->__construct('././upload/2014...')
#1 C:\webroot\piwigo\admin\include\image.class.php(87): image_imagick->__construct('././upload/2014...')
#2 C:\webroot\piwigo\i.php(531): pwg_image->__construct('././upload/2014...')
#3 {main}
  thrown in C:\webroot\piwigo\admin\include\image.class.php on line 416

And no image is generated.

Images files are uploaded in the correct dir:

C:\webroot\piwigo\upload\2014\06\17>dir

Directory of C:\webroot\piwigo\upload\2014\06\17

17/06/2014  21:37    <DIR>          .
17/06/2014  21:37    <DIR>          ..
17/06/2014  20:52           875.585 20140617205206-7df8ff57.jpg
17/06/2014  21:05           875.585 20140617210531-7df8ff57.jpg
17/06/2014  21:37           409.722 20140617213706-df0a7174.jpg
17/06/2014  20:52                   12 index.htm
               4 File(s)      2.160.904 bytes
               2 Dir(s)  22.849.662.976 bytes free

But Piwigo generated path can't find them.

A note: in my web setup Piwigo is not the Apache DocumentRoot site - it is run as alias:

Alias /photo "C:\webroot\piwigo"

<Directory "C:\webroot\piwigo">
    DirectoryIndex index.php
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
    AcceptPathInfo On
    Require all granted
</Directory>

Could it impact the path generation?

 

#9 2014-06-18 23:42:30

LDS
Guest

Re: Imagick exception - blob file not found when uploading image

I made another attempt using FTP and Synchronization, again error...

PHP Fatal error:  Uncaught exception 'ImagickException' with message 'UnableToOpenBlob `././galleries/nature/IMG_0053.JPG': No such file or directory @ error/blob.c/OpenBlob/2657' in C:\webroot\piwigo\admin\include\image.class.php:416
Stack trace:
#0 C:\webroot\piwigo\admin\include\image.class.php(416): Imagick->__construct('././galleries/n...')
#1 C:\webroot\piwigo\admin\include\image.class.php(87): image_imagick->__construct('././galleries/n...')
#2 C:\webroot\piwigo\i.php(531): pwg_image->__construct('././galleries/n...')
#3 {main}
  thrown in C:\webroot\piwigo\admin\include\image.class.php on line 416

I tried to play with the

$conf['upload_dir'] = './upload';

Configuration, passing full paths, removing the ./, using a backslash... sometime no error was displayed, but the image wasn't uploaded either.

If under Linux works, I guess the paths generated aren't good for Imagick under Windows, or something alike, it looks it can't resolve them to the image paths - don't know what Imagemacick thinks the current directory is.

 

#10 2014-06-19 08:20:15

flop25
Piwigo Team
2006-07-06
7037

Re: Imagick exception - blob file not found when uploading image

Many people like me install one or several instance of Piwigo on Windows with Wamp, in local.
So that's your own environment which has something wrong. But we are sorry we don't have many knowledge of the Windows environment as a server


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#11 2014-06-19 21:07:10

LDS
Guest

Re: Imagick exception - blob file not found when uploading image

Ok, understood. Time to drop Piwigo for something developed better.

Bye.

 

#12 2014-06-19 22:34:15

flop25
Piwigo Team
2006-07-06
7037

Re: Imagick exception - blob file not found when uploading image

You could try the well known and very mature Gallery. Oh wait! It doesn't support Windows...


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#13 2014-08-06 10:45:47

hakastein
Guest

Re: Imagick exception - blob file not found when uploading image

I found solution for windows.

Just need realpath in 2 rows.

file image.class.php

86: $class = 'image_'.$this->library;
87: $source_filepath = realpath($source_filepath);
88: $this->image = new $class($source_filepath);

and

496: file_put_contents($destination_filepath, '');
497: $destination_filepath = realpath($destination_filepath);

Thats work for me.

Sry for ma bad english.

 

#14 2014-08-06 18:55:17

flop25
Piwigo Team
2006-07-06
7037

Re: Imagick exception - blob file not found when uploading image


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#15 2014-08-07 03:27:00

hakastein
Member
2014-08-06
1

Re: Imagick exception - blob file not found when uploading image

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact