I created new file stream for storing certain image files(so client can alter via FTP). But the image cache styles not producing.

My Custom filestream path [drupal_root]/test
The path shows for new image cache creation but no such path exist [drupal_root]/test/styles/thumbnail/foobar/small/

Comments

mcdruid’s picture

Status: Active » Postponed (maintainer needs more info)

Could you explain exactly how you've used alt_stream_wrappers to create this new stream wrapper?

Do you see any error messages (e.g. in logs) when this problem occurs?

Can you create directories and files similar to the paths you're trying to use for image styles when running as the same user as Drupal (often www-data)?

mcdruid’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)
pingevt’s picture

Not sure if this is technically a bug or not as I am not using this module but wanted to post this to help others out there that might run into the same issue.

But I am running into the same issue. I created a new stream wrapper b/c I mounted an external storage volume to my server to handle images, audio and video files. I wanted to use this volume for one node type though, so I wanted public to stay normal. This volume was also outside of the Drupal root so I could use it for multiple sites. I created the stream wrapper on my own in a custom module, code below:


/**
 * Implements hook_stream_wrappers().
 */
function MY_MODULE_stream_wrappers() {
  return array(
    'overflow' => array(
      'name' => t('Overflow Files'),
      'class' => 'OverflowPublicStreamWrapper',
      'description' => t('Public local files served by the webserver on overflow drive.'),
      'type' => STREAM_WRAPPERS_LOCAL_NORMAL,
    ),
  );
}

class OverflowPublicStreamWrapper extends DrupalLocalStreamWrapper {
  public function getDirectoryPath() {
    return '/mnt/overflow/sixeight';
  }

  public function getExternalUrl() {
    $path = str_replace('\\', '/', $this->getTarget());
    return url('system/overflow/' . drupal_encode_path($path), array('absolute' => TRUE));
  }
}

However, the images were not being created. In order to get the image styles working I needed to add a menu item to call the image_style_deliver():

  $items['system/overflow/styles/%image_style'] = array(
    'title' => 'Generate image style',
    'page callback' => 'image_style_deliver',
    'page arguments' => array(3),
    'access callback' => TRUE,
    'type' => MENU_CALLBACK,
  );

Seems to all work for me now.

This could potentially be a feature for your module, but as I said I'm not using it so not entirely sure.