سؤال

I'm using jCrop jquery plugin to pass Width Height and x - y cordinates via ajax call to:

With Imagemagick, imagick php extensions i use this:

$picture = new Imagick($src);
$picture->cropImage( $_POST['w'],  $_POST['h'],  $_POST['x'],  $_POST['y']);
$picture->writeImage($outFile);
$picture->thumbnailImage(445, 0);
$picture->writeImage($outFileWeb);
$picture->clear();
$picture->destroy();

Users uploads large images/photos, then they select an area with jCrop to crop. If they select an smaller area of photo to crop everything works as it should. The problem comes when they try to select a larger area of photo to crop, then the php script never returns any results.

I can't figure out how to track whats going wrong or how to debug the problem.

EDIT

In short: How to enable debugging in imagick? Why is imagick not working with larger crop area? Could it be some kind of memory issue / php settings?

Any help appreciated :) Thanks!

هل كانت مفيدة؟

المحلول

Ok, got it to work! It was a memory issue...

Solution (put into your php code before "new Imagick()" :

// pixel cache max size
IMagick::setResourceLimit(imagick::RESOURCETYPE_MEMORY, 64);
// maximum amount of memory map to allocate for the pixel cache
IMagick::setResourceLimit(imagick::RESOURCETYPE_MAP, 64);

Found answer here: http://sourceforge.net/apps/trac/gallery/ticket/1513

And here: https://stackoverflow.com/questions/4367 ... rge-images

Btw: How i debuged was:

  1. Edit in php.ini: log_errors = Off -> log_errors = On Don't forget to restart apache after editing php.ini...

  2. Put this in start of your php code: error_reporting(E_ALL);

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top