Problem is when we want create imagecached file by imagecache_build_derivative() function because javascript crop is ignored by imagecache. Why? Here is explanation:

function imagecrop_javascript_image(&$image, $data) {

  $presetid = '';
  // if a global presetid is been set, it meens the image is generated from the imagecrop module
  if (isset($GLOBALS['imagecrop_presetid'])) {
    $presetid = $GLOBALS['imagecrop_presetid'];
  }
  // and if not, then get the id from list of all presets
  else {

    $args = explode('/', $_GET['q']);
    $key = array_search('imagecache', $args);
    if ($key != FALSE) {

We don't have $_GET['q'] when we creating image programmatically and explode() can't be done. This is bug, I checked it and only javascript crop is omitted.

Comments

nils.destoop’s picture

The problem is, that imagecache doesn't give enough information to the preset actions. So the only way for me, is checking q.
I should check if somewhere in imagecache_build_derivative, i can get more information, but i doubt it.

nils.destoop’s picture

Status: Active » Closed (won't fix)

In both d7 and d6, there is no other possibility to know the current style, then checking the url. So when using image_style_create_derivative directly, imagecrop will never be able to work.