Allowing module defined file types (like .avi) in Gallery

rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 619
Posted: Thu, 2009-09-24 00:07

As I've seen a couple of threads on this forum from people asking for support for additional movie formats (like this thread), I thought I'd start a thread to document my attempts to get Gallery to accept .avi files. At this point I have managed to modify both Gallery and Gallery's server add module to allow importing of .avi video files into Gallery. The relevant changes include --

Server Add Modifications:
Edited server_add/controllers/server_add.php to include lines 51-53 and 129-131 to allow for additional file extensions. Also added lines 247-250 to allow module defined create functions.

Gallery 3 Modifications:
Created file gallery/libraries/File_Extensions.php to maintain an array of file types that can be added onto by module::event functions.
Edited gallery/helpers/MY_url.php to include lines 38-40 to allow for module-defined controllers.
Edited gallery/models/item.php to include lines 219 - 220, 226, 248 - 249, and 255 to allow modules to define an item type with a .jpg thumb when the full size is not a jpeg.
Edited gallery/helpers/graphics.php to include lines 123-126 for allowing modules to specify item types that do not have a resize and lines 137-138 plus line 142 to define additional item types that use ffmpeg for thumbnails.

Note that this has not been thoroughly tested. It's possible that there could be other areas of Gallery that would also need to be modified, that I haven't stumbled across yet. I've basically been editing files one at a time to fix whatever issue I ran into after the previous edit :)

An example .avi can be found in my testing gallery here. As Gallery's video player doesn't support .avi files, I've programmed the site to just display a direct link to it allowing the web browser to decide if it should be played in the browser or downloaded.

Comments? Suggestions? Any better ideas?

Edit:
For anyone following along, I've modified Gallery's simple uploader to work with additional file types as well:
Edited /modules/gallery/views/simple_uploader.html.php to include lines 53-66 and modified line 76 to allow users to select additional file extensions.
Edited /modules/gallery/controllers/simple_uploader.php to include lines 45-56 and modified line 60 to allow the simple uploader to except additional file types. Also modified lines 77-78 and added lines 82-87 to allow the simple uploader to save module defined files.
I also went back and changed the "create_new_item" event to "create_new_FILEEXTENSION" (ex: create_new_avi).

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Thu, 2009-09-24 00:12

rWatcher, are you also signed up on the -devel mailing list and do you ever check out #gallery on IRC?
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 619
Posted: Thu, 2009-09-24 01:11

No, I was going to sign up on the mailing list, but I never seem to get around to it.

Actually... There, one of my emails should now be subscribed.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Thu, 2009-09-24 01:40

Great! This would be a great discussion to have on the -devel mailing list. Maybe get a few other devs involved :) And if anything needs to be tweaked in core to make something like this work hopefully get that done before release.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 619
Posted: Thu, 2009-09-24 02:30
 
psychoph

Joined: 2009-11-15
Posts: 23
Posted: Mon, 2009-11-16 03:19

Did this go anywhere in the core code base? Meaning did the developers accept it and it is in git or as a module that you can grab or is this still you hack your version on your server to work?

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 619
Posted: Mon, 2009-11-16 06:03
psychoph wrote:
Did this go anywhere in the core code base?

Nope, it's still a "use at your own risk" hack. The developers did say something like this might happen, but not until Gallery 3.1 at the earliest.

 
piarres

Joined: 2005-11-03
Posts: 6
Posted: Fri, 2010-06-25 09:28

Hello

Is this system still usable?