0

The site is running in a Windows Server environment.

I have a custom content type, which has a single "image" field.

I have created a image style, called "slider" with the dimensions 800x480

Images uploaded have some issues:

  1. The original file names are kept but all uploads stored in the same folder. Ideally these names would be timestamped or hashed to prevent duplicate collisions

  2. The file dimensions do not seem to be applied in resizing the image, does this only apply if the uploaded image is larger? Do I add a "scale" filter if I want to enlarge the image to fit the dimensions?

  3. Uploaded images go to:

http://www.mydomain.local/sites/default/files/park/pics/BHP_beach.jpg (this exists)

but the preview: http://www.mydomain.local/sites/default/files/styles/slider_desktop/public/park/pics/BHP_beachjpg?itok=lR2G_oG3 (this does not exist)

This latter path is not valid, rather there is no image by this name in this directory??? Why are no files being written here? I just noticed another error which is probably related to the last point I make:

Warning: imagejpeg() [function.imagejpeg]: Unable to open 'public://styles/slider_desktop/public/park/pics/BHP_beach.jpg' for writing: Invalid argument in image_gd_save() (line 270 of C:\mywebsite\modules\system\image.gd.inc).

How do I enable public:// stream wrappers???

Lots of questions I know...but all related to the same thing I think.

1 Answer 1

0
  1. Files will be renamed to prevent collisions. Off the top of my head it adds something like _1 to the filename.

  2. Yes that's correct. I'm not sure about the scale but that sounds like it would work. If the image is too small, it will get scaled up. If the image is too big, it will be resized down then scaled and the scaling shouldn't have any effect.

  3. That all sounds like it's working as intended. You have a simple problem with directory permissions within your sites/default/files directory. If you're in a dev environment try doing chmod -R 777 files (Then you know it's a permissions problem and you can set them properly). Problems like this are usually either because the file cannot be read or written, in your case it looks like writing. The PHP stream wrappers mentioned in the error message are enabled and working, don't worry about that, it's standard PHP. If chmod doesn't work, try changing ownership with chown.

1
  • Its on a Windows development server, so no CHMOD, and I've checked the permissions, they are no different than the uploads directory where the original files get written to. Definetely a permission issue though I stepped through code and its failing when I log is_writeable() Apr 9, 2014 at 4:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.