in ../imageflow/theme/theme.inc/theme_imageflow_image the image src is sent to drupal_attributes as /sites/default/... thus for sites in subdirectories, the image does not show up. Example if my site is accessed through localhost/folder/site, the image src output by the module is localhost/sites/defaults/... instead of localhost/folder/site/sites/defaults/...; thus the image does not show up. You might want to concat $GLOBALS['base_url'] to the current image src

CommentFileSizeAuthor
#9 image_src_url-1811050-9.patch711 bytesdeggertsen
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jamesbenison’s picture

Problem is that the imageflow library does not work with reflections unless the base url is stripped off. It's not missing by accident.

The best solution would be to integrate imagecache actions to create the reflection and do away with the module reflect script.

kengichan’s picture

after debug, i found
1. in ./imageflow/theme/theme.inc theme_views_view_imageflow line 59

$item = $row->_field_data[$view->base_field]['entity']->{$img_field_name}[$lang][0];

my site is with 2 languages, , the $lang = 'english', but the "image_field" , i setup it without lang.
the item must fix to:

   // fix image field for no language 	
    $lang="und";
    $item = $row->_field_data[$view->base_field]['entity']->{$img_field_name}[$lang][0];

2. after upgrade drupal to 7.20
the image src broke again.
/sites/all/libraries/imageflow/reflect2.php?img=../../../../sites/default/files/styles/c400/public/images/certificates/2.jpg?itok=EYu3d-vY

remove “?itok=EYu3d-vY”, become to work.
so , in in ./imageflow/theme/theme.inc theme_views_view_imageflow line 127

$variables['path'] = str_replace ($GLOBALS['base_url'], '', $variables['path']);
//add fix ? to #
  $variables['path'] = str_replace ('?', '#', $variables['path']);
jrreid’s picture

Did a couple changes to make it work for me:

In theme/theme.inc, theme_imageflow_image_style()

  // Determine the url for the styled image.
  // Base path gets stripped out for the reflect script.
  if($variables['style_name']) {
    $variables['path'] = image_style_path($variables['style_name'], $variables['path']);
  }
  $variables['path'] = file_create_url($variables['path']);
  $variables['path'] = str_replace ($GLOBALS['base_url'], '', $variables['path']);

This does bypass the changes in 7.20 about adding the token but that doesn't matter as reflect[2/3].php look for the file on disk anyways. This does leave the issue that the image may not exist in the image style, but I've solved that by also using the images on another page anyways so it does get created.

In imageflow.module, imageflow_add_js()

  $preset['options']['imagePath'] = '';

Instead of ../../../..

David_Rothstein’s picture

wayne57’s picture

I have tried the above but the images still do not appear, only the outlines. I have colorbox configured and when the blank image is clicked the clolorbox image appears ok, but the image flow presenter does not work. I will have to find another way to display clickable images.

caw67’s picture

Assigned: Unassigned » caw67
  // Determine the url for the styled image.
  // Base path gets stripped out for the reflect script.
  if($variables['style_name']) {
    $variables['path'] = image_style_path($variables['style_name'], $variables['path']);
  }
  $variables['path'] = file_create_url($variables['path']);
  $variables['path'] = str_replace ($GLOBALS['base_url'], '', $variables['path']);

this works for me

  $preset['options']['imagePath'] = '';

Instead of ../../../..

this not!
the origanal path works!

deggertsen’s picture

#6 worked as explained worked for me as well. We should probably put this into a patch so that it can be reviewed and committed... I'll try to get to that.

kdmarks’s picture

Same here. #6 worked for me. The first change (to theme.inc) fixed the issue of images not appearing. No need for the second change to imageflow.module.

Thanks for the fix!

deggertsen’s picture

FileSize
711 bytes

First attempt at a patch on this issue. Let me know if I messed anything up (I always seem to mess something up in the first patch attempt).

deggertsen’s picture

Status: Active » Needs review

Forgot to mark as needs review.

jamesbenison’s picture

Status: Needs review » Fixed

Patch in #9 committed.

Thanks deggertsen.

jamesbenison’s picture

Status: Fixed » Needs work

Reopening this issue. The fix above removes the token and allows the reflect script to work. However the image module will not create the new styled image without the token.

One workaround is to put the line $conf['image_allow_insecure_derivatives'] = TRUE; in the settings.php file. But that's a hack.

Ultimately fixing this problem is going to require adding a reflection action to the image module and doing away with the reflect script in the imageflow library. Unfortunately there is no module right now that provides that action.

jamesbenison’s picture

Status: Needs work » Needs review

I just pushed a commit that changes the reflections to use the imagecache_reflect module. You can find that module here: https://drupal.org/node/1366668#comment-7633607

I recommend installing it before doing the update.

Also beware that imagecache_reflect is not technically a real drupal module yet. I'm hoping to get it incorporated into the imagecache_actions library. Things could change.

These changes should take care of all problems related to paths (including base paths), image security tokens, and reflection-effects. Let me know of any trouble that you run into.

jamesbenison’s picture

Imagecache reflect is now a real drupal module.

You can find it here.

jamesbenison’s picture

Status: Needs review » Fixed

Marking as fixed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.