Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Request: support for external images
Patrick_ Offline
Junior Member
**
Posts: 27
Joined: Oct 2011
Post: #1
Request: support for external images
I tried the image upload function, but because it uses PHP to display the image, it's slow and increases the server load.
The alternative is to use an external image (textfield). The problem is that doing it this way, the image isn't verified. I wrote a plugin to hook the verification, but I think it should by part of xthreads.
10-21-2011 01:22 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #2
RE: Request: support for external images
There is no reliable way to verify an image if it's not locally available.

I guess it could be possible to allow direct access to an image rather than force it through a PHP script.

My Blog
10-21-2011 08:32 AM
Find all posts by this user Quote this message in a reply
Patrick_ Offline
Junior Member
**
Posts: 27
Joined: Oct 2011
Post: #3
RE: Request: support for external images
What's wrong with getimagesize for width, height and MIME? I use that combined with CURL to verify that the file exists, and has an acceptable length.
It only fails with very bad servers that don't send the Content-Length header.
10-21-2011 09:35 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #4
RE: Request: support for external images
Checking the file once does not guarantee that it'll be valid forever.
Especially if you're trying to verify dimensions - it's trivial for a server admin to replace a small image with a larger one.

Thus verifying an arbitrary URL seems mostly pointless to me.  Perhaps the only thing I can think of is perhaps tell a clueless user that they need to supply an image link, though requring a .png/.jpg/whatever extension is probably suffice most of the time, and of course, the MyBB [img] tag does no such verification anyway.

My Blog
10-21-2011 11:37 AM
Find all posts by this user Quote this message in a reply
Patrick_ Offline
Junior Member
**
Posts: 27
Joined: Oct 2011
Post: #5
RE: Request: support for external images
I see your point. In my case, it doesn't matter, because I restrict the images to my own image gallery, but for uncontrolled external images, that may be a problem.
10-21-2011 04:52 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #6
RE: Request: support for external images
I guess selecting from a gallery is an interesting case, although somewhat limited in scope.  If there aren't many, you could stick to a select box input, but I presume you would've thought of that anyway, in which case you're probably stuck with your custom modification unfortunately.

My Blog
10-21-2011 08:13 PM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: