Added Tiff Support

Smoonshine

Joined: 2009-11-02
Posts: 8
Posted: Tue, 2010-11-30 14:35

By altering the following files I managed to add tiff support to gallery 3:

1. modules/gallery/view/form/form_uploadify.html.php
Added *.tif and *.tif to the fileExt line on row 31

2. modules/gallery/models/item.php
Added "image/tif" and "image/tiff" to the $legal_values array on line 936 (valid_field function)

3. modules/gallery/controllers/uploader.php
Added "tiff" and "tif" in upload::type array on line 54 (add_photo function)

I found out this only works with ImageMagick as graphics engine. With GD no thumb and resize can be generated. Is this the reason that Tiff support isn't by default enabled in Gallery? And is it possible to add the above lines to the default product?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2010-11-30 15:48
Quote:
And is it possible to add the above lines to the default product?

No. WE narrowed the scope for G3 to cater to 80% of the use cases and let external modules add additional functionality.
Additional functionality for movies for example is:
http://codex.gallery2.org/Gallery3:Modules:videos
So this could be expanded upon or a new module developed.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
gabrielbarreno2

Joined: 2010-07-27
Posts: 11
Posted: Tue, 2010-11-30 16:57

to Smoonshine:

hi, I have Image Magick as the graphics engine.....I've changed the 3 files that you indicate it and now I can upload succesfull.......but the thumb and resize doesn't generated with the TIF files....why?.............sorry about my english but is not my native language

 
Smoonshine

Joined: 2009-11-02
Posts: 8
Posted: Wed, 2010-12-01 08:00
Quote:
No. WE narrowed the scope for G3 to cater to 80% of the use cases and let external modules add additional functionality.
Additional functionality for movies for example is:
http://codex.gallery2.org/Gallery3:Modules:videos
So this could be expanded upon or a new module developed.

Dave

Ok. No problem. I just thought that if it was such a minor change for getting tiff support, you might be interested in integrating it to Gallery. I will see if I can write a module that adds Tiff support. Btw, is it possible to add extra functionality to the default upload dialog or does it have to be (like the videos module) in a seperate upload dialog.

Quote:
hi, I have Image Magick as the graphics engine.....I've changed the 3 files that you indicate it and now I can upload succesfull.......but the thumb and resize doesn't generated with the TIF files....why?.............sorry about my english but is not my native language

That is an issue I had to deal with also. In an already filled Gallery i had the same issue. After setting up a new Gallery and altering the files it generated thumbs and resizes for Tiff files as well. What version of ImageMagick do you use? I use version 6.2.8. Maybe you are using an older version?

 
drhiii

Joined: 2003-04-27
Posts: 397
Posted: Thu, 2010-12-02 03:16

Are there plans for a plugin to handle .tiff support? I'd like to stuff the ballot box and add 1,000 votes.

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Thu, 2010-12-16 20:37

If enough people want it, sure. But I highly doubt that most of our users have any idea what a TIFF is.
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git

 
kandsten

Joined: 2010-11-26
Posts: 79
Posted: Thu, 2010-12-16 20:48

I think it'd be pretty hard to write a module to do TIF support as-is, since the filetype checks are all over the place and in the core code. No sane way to change the lists (unless I'm missing something obvious)

Further commentary: http://gallery.menalto.com/node/99763

 
drhiii

Joined: 2003-04-27
Posts: 397
Posted: Fri, 2010-12-17 07:08

I'd like to add one more vote to the 1,000 already posted.

 
Smoonshine

Joined: 2009-11-02
Posts: 8
Posted: Fri, 2010-12-17 08:09

@kandsten. The only way to add extra filetypes the official way is to do it in a separate module. The problem with that is that you'll have to create a separate upload dialog for that filetype. Not very user-friendly. I agree with Bharat that TIFF isn't an ideal format for web-galleries. But for people who want to use Gallery3 as an image library for their high-resolution files TIFF is a very common format. In other cases Jpeg or PNG is the more useful option.

For myself id decided to convert my TIFF files to high resolution JPEG files. I added an index to the image name where to find the corresponding tiff file.

 
gabrielbarreno2

Joined: 2010-07-27
Posts: 11
Posted: Fri, 2010-12-17 15:29

hi....I'm using ImageMagick 6.6.5-9

 
gabrielbarreno2

Joined: 2010-07-27
Posts: 11
Posted: Fri, 2010-12-17 15:31
bharat wrote:
If enough people want it, sure. But I highly doubt that most of our users have any idea what a TIFF is.
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git

PLEASE DO IT.....PLEASE....

 
kandsten

Joined: 2010-11-26
Posts: 79
Posted: Fri, 2010-12-17 19:53
Smoonshine wrote:
@kandsten. The only way to add extra filetypes the official way is to do it in a separate module. The problem with that is that you'll have to create a separate upload dialog for that filetype. Not very user-friendly.

Actually, the item model verifies the MIME type, sort of, (and the file extension as well in 3.0.1) so you can't even go down that path. Right now it's a no-can-do without hacking core.

 
drhiii

Joined: 2003-04-27
Posts: 397
Posted: Sat, 2011-01-22 08:46

I gave the core code changes a go. No go. Kept getting a server error. From reading suspect it is a php error. I bumped all the php.ini values up for mem and size, and still no go. Was hoping to get some kind of TIFF support, even if it didn't render a thumb or sized but retained the file.

Sigh. So, another tip of the hat for tiff support...