rifanece / timthumb

Automatically exported from code.google.com/p/timthumb
0 stars 0 forks source link

Thumbnails from images without extenstion #18

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I use syndication to fulfil my blog, and some of sources use images without
any extension. Wordpress can handle it and auto detects what kind of mime
file is it and shows pictures properly, but timthumb doesn't show
thumbnails on main page (only files with jpg, jpeg, png, gif are supoorted).

Example:
Image filename: a414f_6a00e55281006188330111684d412c970c-500wi (no extension)

so the timthumb thumb. image file name looks like that:

http://www.thegaypaper.com/wp-content/themes/arthemia-premium/scripts/timthumb.p
hp?src=http://www.thegaypaper.com/wp-content/plugins/wp-o-matic/cache/a414f_6a00
e55281006188330111684d412c970c-500wi&w=80&h=80&zc=1&q=100

Is there any way I can modify timthumb or add possibility to auto detect
mime type in timthumb if image file doesn't have any extension?

Original issue reported on code.google.com by westend...@gmail.com on 10 Feb 2009 at 2:30

GoogleCodeExporter commented 8 years ago
hmmm interesting. Hadn't considered this at all, I will add it to the todo list.

Original comment by BinaryMoon on 16 Feb 2009 at 6:39

GoogleCodeExporter commented 8 years ago
I gather this same issue would also stop me altering the icons/avatar's of 
comment 
posters.  I would be nice to remove the external URL linking for these little 
objects.

An Example of a gravatar icon URL:
http://www.gravatar.com/avatar/bd392f11e5b1a856ed79663775dc2bf8?s=32&d=identicon
&r=G

Original comment by avatarw...@gmail.com on 11 Feb 2010 at 7:40

GoogleCodeExporter commented 8 years ago
Hello,  Just had a quick look at my problem to timthumb my gravatar URLs;  I'm
running FreeBSD and noticed that preg_match in the function mime_type says the 
following:

    if (!valid_src_mime_type($mime_type) && $os != "WIN") {
        if (preg_match("/FREEBSD|LINUX/", $os)) {

I changed this to 

    if (!valid_src_mime_type($mime_type) && $os != "WIN") {
        if (preg_match("/FreeBSD|LINUX/", $os)) {

you could bave done case insensitive matching; but the $os value returns 
'FreeBSD' at
least for me running FreeBSD 6.4 ;with mostly latest other software.

This allows the 'file' directive to return a value

Hope this helps 

Original comment by avatarw...@gmail.com on 11 Apr 2010 at 6:02

GoogleCodeExporter commented 8 years ago
Seeing this with my blog, as well, using a Graph Paper Press theme (which 
embeds timthumb.php to generate thumbnails) and the Photoshelter plugin, which 
adds images to posts using a URL that looks like: 
http://www.photoshelter.com/img-get/I0000vQCP.lyrVMg/s/590 - the filename of 
the image returned is just "590" with no extension. Obviously, timthumb can't 
be responsible for the URL that the Photoshelter plugin generates, and I have a 
workaround (append "/590/thumbnail.jpg" to the URL above). Just wanted to point 
out another use case...

Original comment by davereph...@gmail.com on 28 Jul 2010 at 8:08

GoogleCodeExporter commented 8 years ago
this has now been implemented - woo hoo :)

Original comment by BinaryMoon on 25 Sep 2010 at 10:22