I've enabled the 'store' local thumbnail option for both emvideo field and emimage field, but it's not storing a local thumbnail for the image field. It does work for the video field however.

CommentFileSizeAuthor
#11 providers-thumb.patch1.11 KBcangeceiro

Comments

cerup’s picture

Is it possible to get a confirmation if this is a bug or not?

aaron’s picture

Version: 6.x-1.4 » 6.x-1.6
Status: Active » Postponed (maintainer needs more info)

Can you test with the latest release (DRUPAL-6--1-6) and let me know if it's still an issue? I did some work recently to fix that up.

aaron’s picture

Status: Postponed (maintainer needs more info) » Active

Ah, just reread your post -- not sure how well integrated it is with emimage. That might not actually be working properly for that; there were some other issues I uncovered, not sure if they fixed it across the board.

cerup’s picture

Thanks for the quick reply. :)

I've updated to the latest version and updated the fields to see if they save, but they're not. I assume that since there is an option to select a thumbnail in emimage that the functionality works or is being worked on; it works great for emvideo.

Let me know if you need further tests in order to help.

smichel’s picture

I'm having a problem with this, too. Embedded thumbs from youtube videos get stored just fine, but thumbnails for flickr and photobucket aren't being stored at all.

I'm running the latest releases of Drupal, and all the pieces that fit together. Not sure how much of a help this is, but when this line:

$thumbnail = emfield_include_invoke($field['module'], $item['provider'], 'thumbnail', $field, $item, 'thumbnail', NULL, $field['widget']['thumbnail_width'], $field['widget']['thumbnail_height'], array());

returns, for either Flickr or photobucket, $thumbnail is empty.

How frustrating! This has, alas, cost me a couple days work.

aaron’s picture

Status: Active » Fixed

should be working now. please reopen if you still have an issue.

srsbl’s picture

Version: 6.x-1.6 » 6.x-1.8
Status: Fixed » Active

I'm having the same problem. Still not storing a local thumbnail for the image field, but just for the video field.

cangeceiro’s picture

I'm also experiencing this issue. I see it when i have a view that uses an image cache preset to display the image. i was running 1.8, and tried installing dev, but still get a blank field

cangeceiro’s picture

Here is an update from what I was experiencing.

The issue falls on the provider plugin. if the plugin is void of hook emvideo_PROVIDER_thumbnail then it will never store a local thumbnail that can be utilized. In one example scenario that I had this problem with was the custom_url provider. in this case, I am populating the field with a direct link to the external image. Thus by adding the following function that returns the path to the original image to custom_url.inc I was able to get local thumbnails.

/**
 * Thumbnail support
 */
function emimage_custom_url_thumbnail($field, $item, $formatter, $node, $width, $height) {
    return $item['value'];
}

The flickr provider is a little tricker, if you do a dump on a flickr item you will see that there isn't a direct link to the original jpeg. For this you have to use Flickr's api which also requires a key. So the thumbnail hook will require a little more work then just returning the value.

cangeceiro’s picture

Ok here is the function you will want to add to contrib/emimage/providers/flickr.inc in order to get local thumbnails working with flickr

function emimage_flickr_thumbnail($field, $item, $formatter, $node, $width, $height) {
	$xml = emimage_flickr_request('flickr.photos.getInfo', array('photo_id' => $item['value']));
	$image = 'http://farm'. $xml['photo']['farm'].
			'.static.flickr.com/'. $xml['photo']['server'].
			'/'. $xml['photo']['id'] .'_'. $xml['photo']['secret']. 
			'_m.jpg';
	return $image;
}
cangeceiro’s picture

Status: Active » Needs review
StatusFileSize
new1.11 KB

here is the above in a patch

rockaholiciam’s picture

thanks cangeceiro, that worked.

teh_catt’s picture

Not sure if this is same problem but I cannot get this to work for video. No local copies of emvideo thumbnails are being stored and I am trying to do this so I can use imagecache to format thumbnails of Youtube vids. durpal 6.16 and EMF 6.x -1.8 .

Any help much appreciated.

cglusky’s picture

#10 works fine to bring in thumbs from flickr but the file emthumb.theme.inc is only set up to handle emvideo thumbs for image cache. i am working to see if i can fix that now.

in other words, you can use the emfield image presets with flickr thumbs but not imagecache.

aaron’s picture

thanks, will look at this soon.

cglusky’s picture

re #10 and using '_m.jpg' you can use other URL settings to bring in other size photos (if they exist for the account). Here's the Flickr API URL page: http://www.flickr.com/services/api/misc.urls.html

The emthumb.theme.inc file uses a switch statement and only checks for the emvideo use case. I was able to add a case for "emimage" and pass the file to imagecache.

But for my use case I found that using the latest Feeds module with SimplePie allows you to get the URL from the enclosure, which for Flickr appears to be the largest photo available for each particular feed item. I then mapped the enclosure field in Feeds to an imagefield and all was well for me. So did not need emimage support at all for this use case.

yakker’s picture

Same issue here: YouTube thumbs not being written to sites/default/files - permissions are fine. Anyone else experiencing this? It was working for me in April.

Apologies - I have a different issue, and it looks like it's all my fault :s

Wow (sorry). So it looks like maybe emfield for YouTube videos is not downloading the thumbnail from YouTube or storing it locally. I turned on custom thumbs, uploaded a dummy, saved it. Then refreshed a view it was in that pulls it as a node teaser. Went back, checked the box that says "delete" on the thumbnail. Saved it.

I expected that the original thumb from youtube would be downloaded and stored. It does not get stored - but my templates are connecting to YouTube to find the thumbnail and it displays.

Looking at other nodes on the content edit pages - there is a file path displayed to a thumbnail file, but it cannot find the file. So a file path is being saved, but the thumbnail file is not being stored (there is no file by that name in the directory specified for stored thumbs).

Any insight is very welcome - apologies if what I've written here isn't clear enough!

willhowlett’s picture

#10: thankyou SO much for posting this! have just spent all afternoon trying to get this working.

I'm using the latest version. Does anyone know if this patch will be applied to the full version? Sure to save other people headaches in the future.

edit: by the way, regarding the patch, it seems to make more sense to me to just have

'.jpg';
return $image;
}

at the end of it. Otherwise you only pull in the small size image from Flickr, which gives you less to work with when creating imagecache presets.

Anonymous’s picture

Title: Embeded Thumbnail "store local copy" works for emvideo, but not emimage? » emfield number of fields change from 1 to unlimited resulted in previous data lost
aaron’s picture

Title: emfield number of fields change from 1 to unlimited resulted in previous data lost » Embeded Thumbnail "store local copy" works for emvideo, but not emimage?
Version: 6.x-1.8 » 6.x-1.x-dev
Category: support » bug
Status: Needs review » Fixed

thanks @cangeceiro! fixed.

Status: Fixed » Closed (fixed)

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