THE GOAL: To have a field where the user can upload their tiff image but have it displayed as a jpeg thumbnail.
I'm using imagecache and imagemagick for my image-handling and I'm using Drupal 6 right now because it doesn't look like the fieldfield in D7 can use imagecache presets (imagefield doesn't support tiffs). However if anyone knows how to get this to work in Drupal 7 that would be great too.
-Below are the relevant modules I have installed:
CCK 6.x-2.9
filefield 6.x-3.10
im_raw 6.x-1.2
imageapi 6.x-1.10
imagecache 6.x-2.0-beta12
imagecache_actions 6.x-1.8
If you already know how to do this please PM me. For now I can pay $50 which is why I wouldn't want anyone to spend too much time on this, but if you already know how then it could be lunch money for the week. Please let me know if I need to provide more information.
Thanks!
Comments
_
If it were me, I'd have two separate fields (one filefield for the tiff, one imagefield for the jpg). You should be able to use the media_mover module to have a converted jpg added to the imagefield automatically (then use that for imagecache).
Would media_mover actually
Would media_mover actually convert the tiff to a jpeg?... or are you just saying to use media_mover to attach it after it's converted? Basically the part I'm stuck at is the actual conversion process.
Filefield and imagecache_actions probably work
- I think that you could convert current field widget to generic field.
- Install imagecache_actions.
- Add new preset to File Format switcher (jpeg file).
- Add preset to current field.
I don't know if imagecache_actions can convert tiff to jpeg but you also could create new action in imagecache
Hoping to have helped
Juan
imagecache_actions haven't
imagecache_actions haven't tiff convertation.
http://nikiit.ru
ImageMagick Raw
I know ImageMagick itself can convert a tiff, but it looks like imagecache actions is still catching up. The ImageMagick Raw module looks like it would do the trick, except that I have no idea what to put in the command line.
Unfortunately ImageMagick Raw Effect not seem to help
Unfortunately ImageMagick Raw Effect module has this limitation (see help in modulo):
"Do not add an input or output file. ImageAPI will add "convert" before and a "-quality" option after based on the configuration !settings_link"
so you could not put the output you expect.
Leave the bad taste how easy it would do this with Imagemagick:
and ready. In reviewing the code of ImageCache is another difficulty arises: You can not change the file input and output in actions (by default), so set a new action with this structure, it would be a waste of time.
Now with a bit of time, in a solution a little dirty, I have changed a bit the code functions in imagecache imagecache_build_derivative and _imagecache_cache to allow this work (I do not know what the global consequences in presets, have to try long-term), which I place below:
imagecache.module
and now we can do new action in a new module called imagecache convert images (only works for imageMagick):
imagecache_convertimages.info
imagecache_convertimages.module
This new action seems to work to convert TIFF to PNG and JPEG
Hoping to have helped
Juan
Wow, gonna take a minute to
Wow, gonna take a minute to wrap my head around this and then give it try!
Kind of working
So it looks like this pretty much works with some minor issues...
1. First off, it does actually convert the file which is great!!!
2. I had to manually create the imagecache preset folder for the converted file to live.
3. For some reason, you have to create two folders... it seems like the module is trying to create the file in one spot, and look for it in another.
4. Finally, Imagecache won't display the converted file which is the most important part..(could be because 2 & 3).
Any thoughts?
A second version
I have developed a new version of the module that does not require making modifications ImageCache. This version fixes the errors presented above:
imagecache_convertimages.module
this module does not work with private directory
Juan
Absolutely fantastic work!
Absolutely fantastic work! Thanks.
Question
Hi jvizcarrondo
this is a really nice module. I tried to use it but I am facing a problem.
If I place the convert action first, it convert the image as I want. But I would like to implement this action after several other actions. In that case the convert action does not work.
for example :
- first action scale 130x100 with the scale action
- second action convert to jpeg with your action
in that case the first action is not taken into account.
If I change the order it is working fine. But for what I want to do, I need to convert the image format at the end of a list of differents actions.
So my question is : How can I use your action after other imagecache actions ?
Regards
FYI
I am using drupal 6