MG 1.1 Error uploading jpg

DieselMinded

Well-known member
THE FOLLOWING ERROR OCCURRED:
no decode delegate for this image format `/hsphere/local/home/iiiers/mymilitia.com/internal_data/temp/xfmg4DYURQ'
  1. Imagick->readimage() in XenGallery/Helper/Image.php at line 471
  2. XenGallery_Helper_Image->writeWatermarkIm() in XenGallery/Helper/Image.php at line 428
  3. XenGallery_Helper_Image->writeWatermark() in XenGallery/Model/Watermark.php at line 189
  4. XenGallery_Model_Watermark->addWatermarkToImage() in XenGallery/ControllerPublic/Media.php at line 3219
  5. XenGallery_ControllerPublic_Media->_associateAttachmentsAndMedia() inXenGallery/ControllerPublic/Media.php at line 2988
  6. XenGallery_ControllerPublic_Media->actionSaveMedia() inNobita/Teams/XenGallery/ControllerPublic/Media.php at line 59
  7. Nobita_Teams_XenGallery_ControllerPublic_Media->actionSaveMedia() inXenForo/FrontController.php at line 351
  8. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
  9. XenForo_FrontController->run() in /hsphere/local/home/iiiers/mymilitia.com/index.php at line 13
 
"Mislead" I wouldn't say it's fair to put it like that. I wasn't aware that you can add watermark to other images. All I can go on is the information that I have, and if I missed that the watermark works for other images, I can only apologise.

The information we can go on is the error message itself states that there are no delegates available to support the image. This is either the image being uploaded, or the watermark itself. The underlying watermark format itself is likely to be a PNG. The information I had at one point suggests that PNG is not supported:
imagick
imagick module enabled
imagick module version 3.1.1
imagick classes Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator
ImageMagick version ImageMagick 6.2.8 05/07/12 Q16 file:/usr/share/ImageMagick-6.2.8/doc/index.html
ImageMagick copyright Copyright (C) 1999-2006 ImageMagick Studio LLC
ImageMagick release date 05/07/12
ImageMagick number of supported formats: 64
ImageMagick supported formats ART, AVI, AVS, BMP, BMP2, BMP3, CACHE, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CUR, CUT, DCM, DCX, DOT, DPS, DPX, EPT, EPT2, EPT3, FAX, FITS, G3, GIF, GIF87, GRADIENT, GRAY, HISTOGRAM, HTM, HTML, ICO, ICON, INFO, JPEG, JPG, LABEL, M2V, MAP, MAT, MATTE, MIFF, MONO, MPC, MPEG, MPG, MSL, MTV, MVG, NULL, OTB, PALM, PATTERN, PCD, PCDS, PCL, PCT, PCX, PDB, PICT, PJPEG, SHTML

In isolation, it seemed a reasonable theory that the apparent lack of PNG support was the issue. Now I know the watermark generally works, that's clearly not the case, though this misreporting of information in phpinfo is not ideal.

I have tested the two images. The large version and the smaller version both with your watermark, and they both work fine:

Small
small-watermarked.webp

Large
large-watermarked.webp

At this point, my advice remains the same. Upgrade ImageMagick and the Imagick PHP extension. There are some oddities in the info being reported, which could be indicative of an issue. As you stated earlier, the issue is only apparent when the file is saved in a specific way from Photoshop. It's not unreasonable to think that older versions of ImageMagick - which this is - (or the imagick PHP extension) may be falling over and detecting this as some other format under some conditions.

It has to be fairly clear this is not a code issue.

We take an image, we pass its path into the standard and documented Imagick PHP methods, and it even works perfectly in the overwhelming majority of cases. The exact reproduction case even works on other servers. There isn't a single thing here we can change to impact its behaviour.

At this point if your host is unwilling to take any steps to attempt to rectify the issue, then no more support from our part will be provided.
 
Switched watermark to a jpg and tried to upload the media promo file and got a new error...

THE FOLLOWING ERROR OCCURRED:

Insufficient memory (case 4) `/hsphere/local/home/iiiers/mymilitia.com/internal_data/temp/xfmgu61yGV'
Imagick->writeimage() in XenGallery/Helper/Image.php at line 505
XenGallery_Helper_Image->writeWatermarkIm() in XenGallery/Helper/Image.php at line 428
XenGallery_Helper_Image->writeWatermark() in XenGallery/Model/Watermark.php at line 189
XenGallery_Model_Watermark->addWatermarkToImage() in XenGallery/ControllerPublic/Media.php at line 3219
XenGallery_ControllerPublic_Media->_associateAttachmentsAndMedia() in XenGallery/ControllerPublic/Media.php at line 2988
XenGallery_ControllerPublic_Media->actionSaveMedia() in Nobita/Teams/XenGallery/ControllerPublic/Media.php at line 59
Nobita_Teams_XenGallery_ControllerPublic_Media->actionSaveMedia() in XenForo/FrontController.php at line 351
XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
XenForo_FrontController->run() in /hsphere/local/home/iiiers/mymilitia.com/index.php at line 13

_________


ImagickException: Insufficient memory (case 4) `/hsphere/local/home/iiiers/mymilitia.com/internal_data/temp/xfmgu61yGV' - library/XenGallery/Helper/Image.php:505
Generated By: fixer, 2 minutes ago
Stack Trace
#0 /hsphere/local/home/iiiers/mymilitia.com/library/XenGallery/Helper/Image.php(505): Imagick->writeimage('/hsphere/local/...')
#1 /hsphere/local/home/iiiers/mymilitia.com/library/XenGallery/Helper/Image.php(428): XenGallery_Helper_Image->writeWatermarkIm('50', '5', '5', 'r', 'b')
#2 /hsphere/local/home/iiiers/mymilitia.com/library/XenGallery/Model/Watermark.php(189): XenGallery_Helper_Image->writeWatermark('50', '5', '5', 'r', 'b')
#3 /hsphere/local/home/iiiers/mymilitia.com/library/XenGallery/ControllerPublic/Media.php(3219): XenGallery_Model_Watermark->addWatermarkToImage(Array)
#4 /hsphere/local/home/iiiers/mymilitia.com/library/XenGallery/ControllerPublic/Media.php(2988): XenGallery_ControllerPublic_Media->_associateAttachmentsAndMedia(Array, Array, Array)
#5 /hsphere/local/home/iiiers/mymilitia.com/library/Nobita/Teams/XenGallery/ControllerPublic/Media.php(59): XenGallery_ControllerPublic_Media->actionSaveMedia()
#6 /hsphere/local/home/iiiers/mymilitia.com/library/XenForo/FrontController.php(351): Nobita_Teams_XenGallery_ControllerPublic_Media->actionSaveMedia()
#7 /hsphere/local/home/iiiers/mymilitia.com/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#8 /hsphere/local/home/iiiers/mymilitia.com/index.php(13): XenForo_FrontController->run()
#9 {main}
Request State
array(3) {
["url"] => string(41) "http://www.mymilitia.com/media/save-media"
["_GET"] => array(0) {
}
["_POST"] => array(16) {
["type"] => string(8) "category"
["category_id"] => string(1) "3"
["image_upload_type"] => string(6) "upload"
["image_upload"] => array(1) {
[226] => array(6) {
["media_title"] => string(11) "Media Promo"
["media_description"] => string(31) "http://www.mymilitia.com/media/"
["tags"] => string(0) ""
["media_tag"] => string(0) ""
["media_embed_url_original"] => string(0) ""
["media_embed_url"] => string(0) ""
}
}
["media_image_upload"] => string(4) "true"
["media_"] => string(4) "true"
["image_upload_hash"] => string(32) "80d3ce08290fef14955bd1210c0e3a14"
["video_upload_hash"] => string(32) "6c40c121c097e3ab80e603be29a988f6"
["embed_url"] => string(0) ""
["container_type"] => string(8) "category"
["container_id"] => string(1) "3"
["_xfConfirm"] => string(1) "1"
["_xfToken"] => string(8) "********"
["_xfRequestUri"] => string(10) "/media/add"
["_xfNoRedirect"] => string(1) "1"
["_xfResponseType"] => string(4) "json"
}
}
If the watermark works on other images, just switch it back to what it was.
 
This is beginning to make sense ...

ImageMagick version installed is the latest supported by OS installed on a web server. As fo imagick PHP extension, you know from the previous replies that I tried installing latest version but as it failed I had to go with a bit older one. So at this stage I would advise you to prepare the images in photoshop so that they can go through.

In the meantime, I will try another another approach and see if I can install more recent ImageMagick with more newer imagick PHP extension on another PHP. Does your script support PHP 5.5 ?
 
Back
Top Bottom