Posted by whereisian on May 8, 2008 at 5:48am
Jump to:
| Project: | ImageAPI |
| Version: | 6.x-1.x-dev |
| Component: | ImageAPI Imagick |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
I work in library and archives and deal with a lot of tif files. Is it be possible to implement a tif to jpg derivative system that could be used by either imagecache and/or imagefield? I know that imagemagick supports are wide variety of file types so other types could be easily added.
I've done simple convert image.tif image.jpg and it works nicely. Would this be difficult? I be happy to test any way I can, although I have no real coding skills.
Comments
#1
this'd need to be committed to HEAD and then backported but yeah, this should be do-able... i guess the trick would be to have a list of "valid" web extensions like jpg, png and gif and if the original extension isn't in that list replace it with jpg.
#2
Brilliant. Good news. I'm surprised this issue hasn't come up elsewhere. I've had a few thougths, so I hope this helps.
Imagefield provides an option to restrict by file extention. Currently, this happily allows me to add tif, pdf and psd file types. Ideally, I suppose imageapi could validate that against the toolkit being used. Imagemagick will spit off a list of supported types with
identify -list format.If I understand correctly, imagecache wouldn't need to be aware of a conversion because it calls imageapi. So It would ask for a derivative of a tif and receive a jpg.
The only thing other than that is that imagefield will still fail to display a thumbnail of the original file on the node edit page. Would it be worth starting a feature request to see if it could display a scaled image of an imagecache file?
Please let me know how I can help. I've busted out my PHP book and api.drupal.org and am trying to decifer the code.
#3
I also work for an archives & library (in Mississippi) and I'm looking for exactly this same functionality. I may take a crack at it myself, but I look forward to seeing what more experienced people come up with.
#4
I'm just starting to wrestle with this as well for our intranet; we have several scientists who work with tiffs for a lot of images. Checking the list of formats that imagemagick supports, maybe it's worth adding support for creating web viewable versions of tiffs plus PDFs, something else that gets uploaded often (at least here).
#5
imagemagick supports them all (tiff, bmp, etc) and can convert them to .jpg which would be the best option for display due to size limitations!
#6
Subscribing
#7
This issue in the imagecache module is primarily addressed at converting PDF files using imagemagick, but would also work for tif files: #366373: PDF support ( i.e. convert PDF to JPG support).
#8
we still need a patch for the ImageField for this to work. Aren't we ?
#9
I have tested the work so far with filefield, but not with imagefield. Given that the changes are at a fairly low leve, I suppose it might work for imagefield...but I don't know.