How to add new mime-types?

ajoman
ajoman's picture

Joined: 2004-08-26
Posts: 9
Posted: Tue, 2005-01-04 12:15

Hi,

I just wonder how I should proceed if I want to add a new mime type (in this case video/3gpp (.3gp)) and be able to assign it an own thumbnail?

As it is now, my G2 renames the file so that it has no extension at all.

----
Gallery version: Core 0.8.7, Thumbnail Manager 0.8.3
Webserver: Apache2, Win32
PHP version: 4.3.8

 
volksport
volksport's picture

Joined: 2002-10-06
Posts: 239
Posted: Tue, 2005-01-04 14:27

G2 takes the mime types directly from apache I believe. Do you already have it as a valid filetype?

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Tue, 2005-01-04 21:14

3gpp isn't listed in our mime type listing, so here's what you need to do.

Edit modules/core/classes/helpers/MimeHelper_simple.class and add a mapping from .3gp to video/3gpp

Edit modules/core/module.inc and add video/3gpp to the GalleryMoveItem factory registration (search for "registerFactoryImplementation").

That should be enough to get it classified as a movie. Now, if it can be viewed inline in the web browser via a plugin, you can:

Edit modules/core/classes/GalleryMovieItem.class and add video/3gpp to the canBeViewedInline() method. Then edit the render() function and add whatever HTML or Javascript is used to actually render the movie.

That should do it. If you can do it fairly cleanly and test it, we'll be happy to take this back and commit it to the codebase. Thanks!

 
cnmuranjan
cnmuranjan's picture

Joined: 2005-05-17
Posts: 39
Posted: Sat, 2005-05-21 21:48
bharat wrote:
Edit modules/core/module.inc and add video/3gpp to the GalleryMoveItem factory registration (search for "registerFactoryImplementation").

I didnt find such thing in module.inc file (Im using G2b3).

I also want to add .3GP and .AMR extensions as MIME type...
Both can be playable using QuickTime player...

So is there any other way to add these extensions ?

regards,

-- Chinmay

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sun, 2005-05-22 06:32

activate mime module, go to site admin / mime types.

 
cnmuranjan
cnmuranjan's picture

Joined: 2005-05-17
Posts: 39
Posted: Sun, 2005-05-22 06:51

I activated MIME module..
and also added .3GP extension in video/quicktime MIME type by editing it...

But real Q's is, where to add .AMR extension, as it is in audio format and only playable with QuickTime ?

regards,

-- Chinmay

 
cnmuranjan
cnmuranjan's picture

Joined: 2005-05-17
Posts: 39
Posted: Sun, 2005-05-22 07:40

Hello...

I have QuickTime Audio embedding code...
But I dont know where to add this code...

OR visit :
http://web.ics.purdue.edu/~ginnyjr/chrisclass/

Any help?

regards,

-- Chinmay

 
cnmuranjan
cnmuranjan's picture

Joined: 2005-05-17
Posts: 39
Posted: Sun, 2005-05-22 13:56

Hello,

Pls help me about this issue...

becoz converting files into another format and den uploading is a bit frustrating task

regards,

-- Chinmay

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2005-05-22 14:19

cnmuranjan, bumping your posts within hours our a few days won't have the desired effect.

 
cnmuranjan
cnmuranjan's picture

Joined: 2005-05-17
Posts: 39
Posted: Sun, 2005-05-22 18:42

sorry..but u misunderstand me...

Im really waitin for some +ve reply to add .AMR as audio playable with QT...

regards,

-- Chinmay

 
cnmuranjan
cnmuranjan's picture

Joined: 2005-05-17
Posts: 39
Posted: Mon, 2005-05-23 19:09

Im waiting here ... :cry:

I just want to add .AMR as audio extension which is playable by QuickTime...
and I ddnt find any audio xtensions which r configured with QT...

sorry in advance...

regards,

-- Chinmay

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Tue, 2005-05-24 03:32

Please file a feature request on http://sf.net/projects/gallery and then wait patiently. We'll get to it when we can.

 
chopinhauer

Joined: 2004-06-21
Posts: 9
Posted: Sat, 2005-06-04 23:17

Have you tried to do the following things:

1. Navigate to Gallery Administration -> Mime types and add the MIME type audio/3gpp to the extension AMR. (Yes, the correct MIME type should be audio/3gpp as you can see in RFC 3839)

2. Navigate to Gallery Administration -> thumbnails and give the new MIME type the audio thumnail to see it in albums.

What does go wrong if you do this (sorry, I am lazy, I don't want to put strange non-picture media types into my gallery)