Page 1 of 1
Mime types
Posted: Tue Feb 21, 2006 4:59 pm
by lordcoffee
Hi!
If I upload a .mov file to my mediagallerie it shows me the "mime_unknown.png". Is there a way that s9y recognizes that this file is a mov and if I upload a eg. mov.png to the admin folder that it will take this one?
Thanks,Lordcoffee!
Re: Mime types
Posted: Tue Feb 21, 2006 5:13 pm
by garvinhicking
Which s9y version are you using?
The file extension '.mov' is listed as "video/x-quicktime" in our MIME recognition code. It might be that the PHP "getimagesize" function is interfering and reporting a mimetype already...
Note that only PDF and images currently have mimetype images.
Support for other mimetypes has not yet been included to s9y; I just committed it into Serendpity 1.1-alpha1, where you can have "admin/img/mime_XXX-YYY.png" images that are used, if they exist.
http://svn.berlios.de/viewcvs/serendipi ... 942&r2=967
Best regards,
Garvin
Posted: Tue Feb 21, 2006 7:08 pm
by lordcoffee
I now have removed the lines from the svn and uploaded a mime_mov.png but nothing happens. Is the name for the .png wrong?
Lordcoffee
Posted: Tue Feb 21, 2006 7:11 pm
by garvinhicking
Hi!
You must not only remove those lines, you must also add the lines that have been changed! You might need to read a bit about the "patch" format, or you need to upgrade to serendipity 1.1-alpha1.
"mime_mov.png" is wrong, you need to use the mime type of the file. That means you must create a "mime_video-x-quicktime.png" file.
Regards,
Garvin
O.K.
Posted: Tue Feb 21, 2006 7:27 pm
by lordcoffee
Of course I've added the lines...

And it works fine! Thanks.
I'm also using the usergallery event plugin. This one contains the lines:
else {
$image['isimage'] = false;
$image['link'] = serendipity_getTemplateFile('admin/img/mime_unknown.png');
}
What have I to insert there to use the "mime_video-x-quicktime.png" as it works in the adminpanel?
Thanks again!
Re: O.K.
Posted: Tue Feb 21, 2006 8:52 pm
by garvinhicking
You could try this:
Code: Select all
$image['link'] = serendipity_getTemplateFile('admin/img/mime_' . preg_replace('@[^0-9a-z_\-]@i', '-', $file['mime']) . '.png');
if (!$image['link']) {
serendipity_getTemplateFile('admin/img/mime_unknown.png');
}
Regards,
Garvin
Posted: Tue Feb 21, 2006 10:19 pm
by lordcoffee
No, this doesn't fix it. Maybe a link will help you:
The Link
The first file is the .mov file of course.
Lordcoffee
Posted: Tue Feb 21, 2006 10:45 pm
by garvinhicking
Try to use $image['mime'] instead of $file['mime'].
Regards,
Garvin
Posted: Wed Feb 22, 2006 2:28 pm
by lordcoffee
Garvin you're great!
That works! One Problem left and I have my blogintern gallery...
The files wich are no images (like mov or pdf) are added with this little "link" Icon from Carls default Theme because the style.ccs of the theme says, all links have to show this icon. where and what have I to change to get this Icon away but only in the gallery. In the entrys its ok if its there.
Example here
Posted: Wed Feb 22, 2006 2:55 pm
by garvinhicking
Carl's link icon has been removed from his theme in the 1.0 branch and 1.1 trunk since it generally imposes BC problems. So please update your template and remove the CSS instructions also there.
The CSS code did not work in a backwards compatible way, so we first need to have 1.0 working for a bit, where a new CSS selector has been introduced that allows this styling in future releases.
Search for "background-image" declarations in your style.css file and then remove those which are repsonsible for the link icon...
Have fun,
Garvin