how would i force a certain image style to be made for a image upload when it is not used in the same content type.
and yes i know that sounds confusing so i will explain what im trying to do.
i got a content type setup with a imagefield that uses one style and that part works fine but i also made a 2nd style that makes a 960x220 version of the same image for use by a script i got in my header which shows a slideshow of images in my header and since this extra image style is used nowhere in this content type there wont be any images made using my extra image style so i need a way to force the image style system to generate images for this style even when it thinks there not in use.
Comments
Views?
Views-type slideshow displays aren't ported quite yet for D7, but such an approach should be able to do what you want. Views in D7 supports designating a particular image style for a given display. I realize that's not something that's going to help you today, though.
http://drupal.org/node/774798 suggests a way you might get the system to generate the image style you need, by creating your own custom display type and designating the style for that field there.
ya thanks the slideshow
ya thanks
the slideshow banner i already had working with my own code and to force a image style to be made for it i just added a unused display type and used that to set it up.
since my site doesn't use rss i just added my modified display to the rss display type and made that one use the images i want.
though i actully do provide RSS feeds in a later version of the site once there is more content so i need to find a other work around or find a way to make a custom display type.
If you don't mind coding the
If you don't mind coding the image directly into your theme files you could try something like:
[Edit] I was fooling around with theme_image_formatter() and it throws up an error (although still creates the image) if you don't include a path array in $image. Don't really know what it does though. Also, didn't like me substituting $language for 'und'.
The path array is for "An
The path array is for "An array containing the link 'path' and link 'options'". Basically it gives you the option of linking your image with all the options.
More on the api here:
http://api.drupal.org/api/drupal/modules--image--image.field.inc/functio...
I hadn't seen the image_style_url yet though.
Thanks for the tip!
I decided to play with the path array and noticed this post:
http://drupal.org/node/1038932
Basically you have to include the options even if they are empty which is being patched.
Example:
Simple solution for pregenerating styled images
I had to pre-generate images derived from a field in one content type for use with Facebook-Like s. What I did is:
The code should generate styled images even for fields hosting more than one image. I did not need that so this is untested.
I found much of the code in Gabor Szanto's Image Style Pregenerate-Module so big hands for him. Hope this helps out, especially if you do not want to install views just for this one task.