Hey there,

I converted your module to work on Drupal 7. The module now belongs to the "Media" category and the user can define the size of the preview image (ImageMagick'S convert executable will scale the image and keep aspect ratio).

I'm new to Drupal module development, so I'd appreciate any help. Right now I'm trying to find out how to tell the Media Browser to use my preview images for PDF files.

Cheers!

Florian

Comments

floeschie’s picture

Version: 6.x-1.0 » 6.x-1.x-dev

Sorry, I selected the wrong Version. Just read that I should commit patches against the latest dev version.

floeschie’s picture

Category: feature » task
Status: Active » Needs review
StatusFileSize
new14.56 KB

Added the File object to the render array so one can access all the file's attributes in the field templatem for customized output.

juanjo_vlc’s picture

Thanks floeschie, it looks well.
I'm not able to take care of 7.x release at this moment, so, I set you as co-mantainer of this module, please, feel free to upload your 7.x release to git repo.

Thanks in advance.

adamgerthel’s picture

@floeshie I'm looking for a D7 version. Is your code here the latest?

Also, does the module work with GD tools?

floeschie’s picture

@AdamGerthel: GD cannot handle PDF files AFAIK...

wOOge’s picture

StatusFileSize
new13.63 KB

I made some changes to current D7 Dev (dated March 8, 2012), it wasn't writing the previews, now it is, and works on a private files system.

Attached is an updated module, but I can't get the rendered JPG to show on the page. Can anyone with more knowledge on this module, (and experience making patches) help?

wOOge’s picture

StatusFileSize
new13.91 KB

Removed some debugging stuff I left in there. Here is a new file.

wOOge’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
adamgerthel’s picture

StatusFileSize
new13.47 KB

Here's our version that displays the images

wOOge’s picture

@AdamGerthel Thanks for this — your version works, except when private files are enabled, the image is not displayed. Any ideas as to why?

adamgerthel’s picture

No, I'm not sure - and I didn't write the code myself. It could have something to do with where the files are being saved.

Anyway, I forgot to mention that we removed the md5 key in the filename. We didn't really see it as necessary since the FID is always unique

juanjo_vlc’s picture

Sorry, I've been very busy and I didn't have too much time to maintain this module or resolve incidences. I didn't see @AdamGerthel's work since now, so I've fixed the code from @floeschie work.

Please, take a look at 7.x-2.0 release. It has some improvements and compatibility with image styles.

juanjo_vlc’s picture

Status: Needs review » Closed (fixed)