I have a video-sharing site that uses emfield and imagecache to produce nodes with content pulled from youtube: http://movingpaper.org/. I'd like to represent those nodes through ddblock with nodequeue. I've actually gotten about 90% there - as you can see at the link, ddblock is pulling from a nodequeue with two content types, 'News item' and 'video_submission.' The views for both content types are sending images through imagecache to resize and crop as appropriate. The imagecache-processed image for 'News item' is being pulled into ddblock as expected (currently, it's the ddblock slide with the flower), but for images from the content type 'video_submission' it wasn't working at all (grey box). As a temporary measure, I added the following to my template.php file so that I can pull the images directly from youtube:

if (isset($result->node_data_field_embed_video_field_embed_video_data)) {
             $data=unserialize($result->node_data_field_embed_video_field_embed_video_data);
             if (isset($data['thumbnail']['url'])) {
                $slider_items[$key1]['slide_image'] = '<img src="' .$data['thumbnail']['url'] .
                '" alt="' . $result->node_data_field_custom_pager_text_field_custom_pager_text_value .
                '"/>';
             }
          }

What I'd like do is to pull the processed images of the 'video_submission' content type from imagecache so that the images are cropped and sized correctly. I suspect that I need to make an adjustment in my template.php to the preprocess_ddblock_cycle_block_content function, probably around here, but I'm not sure how to proceed:

if (module_exists('imagecache') && is_array(imagecache_presets()) && $vars['imgcache_slide'] <> '<none>'){
              $slider_items[$key1]['slide_image'] =
              theme('imagecache',
                    $vars['imgcache_slide'],
                    $filepath,
                    check_plain($result->node_title));
            }

Any advice would be greatly appreciated. And thanks for the fantastic module.

CommentFileSizeAuthor
#4 ddblock.jpg138.86 KByskel

Comments

ppblaauw’s picture

Status: Active » Postponed (maintainer needs more info)

I don't think you can use imagecache for images which come directly from Youtube.

What image cache does is:
When a given file on the server is called via the imagecache module, it looks if the file is already processed by image cache. If it is it takes directly the processed image, otherwise it creates the processed image and uses it. The original image needs to be available on the server.

Other option is:
You need to upload images yourself for the videos with e.g a separate imagefield.
With this image field you can use image cache again to process images automatically.
When you process images by hand you don't need image cache at all.

Hope this helps you further, please let me know

yskel’s picture

Hmmm. I'm definitely using imagecache to process images from youtube - emfield handles grabbing the image. In my setup, it creates a field called Content: post your own video (field_embed_video) from which I can select imagecache presets. I'm using this setup already imagecache to produce the thumbnails, and imagecache is already creating versions that I'd like to use in ddblock.

Example: this image is currently being used in ddblock, pulled directly from youtube, but
this version is the one that I'd actually like to use.

So, I guess my question really is: what do I need to do to get images from the Content: post your own video (field_embed_video) field to actually show up in the ddblock view? If I just put this field into the view, I get grey blocks, even though the images definitely have been processed by imagecache and exist on the local server (which is why I added that bit to pull directly from youtube in the first place).

Thanks for the help - your module is awesome.

ppblaauw’s picture

I did not know that it is possible to set image cache presets for thumbnails coming from a provider.

Edit:

When I enabled the Embedded Media Thumbnail submodule I see that you can store the thumbnail locally provided by a provider, which makes using Imagecache possible.

End edit:

Where do I set the imagecache presets for an embedded video thumbnail?
Can you give me the path?

yskel’s picture

StatusFileSize
new138.86 KB

I added the imagecache preset at /admin/build/imagecache/add, and then it just worked for me - I was able to choose those presets in Views for the field Content: post your own video (field_embed_video).

I had to throw this site together pretty quickly, and so didn't get a chance to build a backup site for testing / development. I was thinking about duplicating this onto a hosting account I'm not currently using - would it be helpful for you to get access to this particular installation?

josh