oseawey / timthumb

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

External images issues #100

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm migrating an existing, multi-author site with several hundred posts to 
Woothemes' Gazette theme, which uses timthumb.  Most of the images in the 
existing articles (there are hundreds) were added via drag and drop from 
external sites or cut & paste from another editor (word, google docs, etc.), so 
are not in the media library.  The theme developer gave me the code to allow 
external images by changing "if ($isAllowedSite) {" to "if (1==1) {" and this 
makes about 75% of the thumbails work properly.

Of the remaining 25%, I've noticed a few common issues that are causing 
timthumb to fail:

1) Most of the problem is caused by the image having no extension, either 
because it never had one or because there's a space in the filename that causes 
it to look like there's no extension.  WP clearly picks up the mime type in the 
post itself and deals with it fine, but timthumb isn't doing the same.

2) In posts where picapp has been used, the image will fail.  I understand why 
timthumb can't see the image behind picapp's js, what I don't understand is why 
it's even trying...it should just ignore it and either move on to the next 
image, or if there is no other, treat the post as if it has no image.  I've 
also noticed picapp ignoring other valid images in such posts, even when 
they're before the picapp image.

3) In one very strange case, a post with 2 jpgs failed with the message: 

Unable to open image : 
/var/www/sn-dev/html/wp-content/themes/gazette/./cache/7b0b9a9e3fad4f53bd4f97503
cbf75f4.swf
TimThumb version : 1.14

Even though there were no swf's in the post at all.  

-----------

In general, I'm wondering if there's a way to:

a) fix problem #1 - timthumb should be able to pick up mime types as well as 
wordpress, and it's not

b) make timthumb fail more gracefully when the filetype is not an image, taking 
care of my picapp and swf cases.  It should just ignore it and move on

c) set a default image (e.g. generic site graphic) that's used when timthumb 
has no other image  

Thanks for your help!

Original issue reported on code.google.com by erikjond...@gmail.com on 11 Jul 2010 at 2:11

GoogleCodeExporter commented 9 years ago
i also want to know how to make timthumb enable display of external image.

Original comment by metallic...@gmail.com on 5 Aug 2010 at 4:18

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Given the number of WordPress installations out there with remote image 
hosting, IMHO this is the largest issue with WP adoption of the timthumb script.

Automatic thumbnail generation is a powerful and, I believe needed extension to 
WP.  The issue for timthumb is that it appears befuddled by the extensions.  
Picasa has a strange implementation to begin with, but Flickr is fairly 
straightforward...

I notice that Woothemes has implemented an interesting logic to generate 
thumbnails, even for remote servers, and without having to explicitly make the 
photo the featured image; as a last resort, it finds and generates the 
thumbnail from the first image in the post.  

I found the php logic on the Internet but can no longer locate it, or I would 
attach it here.

Great work fellows.  You are adding immensely to the WP library.

Original comment by jvl...@gmail.com on 14 Feb 2011 at 11:45

GoogleCodeExporter commented 9 years ago
This issue happens to be also related to the issue i posted @ 
http://code.google.com/p/timthumb/issues/detail?id=122 

Providing a solution to issue 122 would provide a partial solution for this one 
too.

Original comment by lin.fred...@gmail.com on 10 Jun 2011 at 1:49

GoogleCodeExporter commented 9 years ago
TimThumb can already resize external images, as described here: 
http://www.binarymoon.co.uk/2010/08/timthumb-part-2-external-websites/

Original comment by BinaryMoon on 14 Jun 2011 at 1:14

GoogleCodeExporter commented 9 years ago
BinaryMoon - I understand that TimThumb can resize external images -- I even 
said in the defect writeup that I had enabled it on my site. I was pointing out 
specific problems with how it works, none of which are addressed in the link 
you provided.

It's your code, so you're not obligated to fix this. I just wish that if you'd 
decided not to, you'd say so outright -- instead of providing a glib response a 
year later that doesn't address the concern.

Original comment by erikjond...@gmail.com on 14 Jun 2011 at 1:22