I'm trying to call file_get_image() directly and am passing in the node from node_load() for the file, so passing a file object.

Irrespective of which node is passed, there are only two images that are returned for "file_image_thumbnail" and "file_image_medium".

I've ensured it's a different file object for each.

Comments

JerryH’s picture

Title: file_get_image() inconsistant return » file_get_image() inconsistent return
JerryH’s picture

Status: Active » Closed (fixed)

Turns out I was passing the node, and it's not what is needed. The file node within the node object is.

so :

print file_get_image($mynode->file, 'file_image_thumbnail');

opposed to :

print file_get_image($mynode, 'file_image_thumbnail');

Now on to figure out what to do if there is no thumbnail !

JerryH’s picture

Status: Active » Closed (fixed)

Looks like it's a case of it just not existing, have to figure out how to force generate them now.

Nope

Looks like it defaults to a random thumb nail, it is inconsistent.

When $generated is built, it looks like it just grabs the last one.

JerryH’s picture

Status: Closed (fixed) » Active
miglius’s picture

Status: Closed (fixed) » Active

This function works in the following way:

One should pass a preview handler for an image, i.e. file_image_preview, file_image_medium, file_image_thumbnail or custom defined one. The function will return a html snippet for a scaled image described by that handler or the original image itself is there is no scaled image available. The later case is needed for the situation where the original image is smaller than the thumbnail and therefore a thumbnail for it is not generated.

JerryH’s picture

Hi there :)

Thanks for the info, seems that it works fine now !

The only way I can break it now is if I switch handler for different images on the same page, i.e. one node a with 1 image use file_image_medium then later (in the same view) have node b that has > 1 image, and switching the handler to file_image_thumbnail it seems to stick with file_image_medium.

Testing and investigation continues for that one, though isn't such an issue any more as we're onto movie handling now.

Also and the real tricky one for me at the moment !!! I'm using lightvideo when the mime type detected is a movie.

flowplayer (3.1.2.) loads in the lightbox just fine, though the bitcache URI being returned (that I'm selecting out) is to the original AVI file opposed to one that refers to the FLV conversion (that works on upload).

If I go to the node view that has the attached AVI and select preview, flowplayer loads in thickbox and plays the flv (of the avi) just fine, though when I hunt around in the source I see a bitcache URI that is in the database in the RDF tables.

Is there some function for "give me the FLV of the mime type movie for this file node" ? or some where else I should be looking ?

I can see the URI in rdf_resources.rid = 163 , just need to figure out how to select that in relation to the original. Is there a table foreign keying to it ? Or a even simpler/better way to get at it.

Any ideas there would be very helpful as I really want to use this module in our new build as it's doing everything else fabulously at the moment, thanks :)

/me hunts in the RDF module, there MUST be a way of getting the triple out .......... I thought that was the whole point !!

miglius’s picture

http://drupal.org/node/487580#comment-2171450 describes how to get a link for a flv file.

johanneshahn’s picture

Status: Active » Closed (fixed)