VOGONS

Common searches


Embedding "zoomable" images?

Topic actions

  • This topic is locked. You cannot reply or edit posts.

First post, by 133MHz

User metadata
Rank Oldbie
Rank
Oldbie

I was writing kind of a long post with a lot of pictures in it when I noticed that my usual method of embedding large images in BBCode forums didn't work here, for example:

[url=http://133fsb.files.wordpress.com/2012/02/dscn1340.jpg][img]http://133fsb.files.wordpress.com/2012/02/dscn1340.jpg?w=600[/img][/url]

yields a 600 pixel wide image that when clicked on opens up the full sized version in all of the other forums I frequent. The "?w=600" parameter seems to make the img tag stop recognizing the URL as a valid image file, like this:

dscn1340.jpg?w=600

If I remove the parameter it works fine but then the picture is huge and breaks the forum layout aside from being slow to load. The url tag seems to be trying to do its job though:

dscn1340.jpg?w=600

Is there an alternative way to do it? If so, please let me know. Thanks!

http://133FSB.wordpress.com

Reply 1 of 5, by megatron-uk

User metadata
Rank Oldbie
Rank
Oldbie

Its dependent on the web server - Wordpress has tons of plugins and extra features, one of which is auto resizing of images on the fly. 'BBCode' by itself doesn't do those things.

What is happening with that URL: http://133fsb.files.wordpress.com/2012/02/dscn1340.jpg?w=600 is that the server running the wordpress software on the *.files.wordpress.com domain takes the request for the image file and serves it back via a PHP script that does your resizing and auto-linking to the full version. That's different to the way a web server normally works for a static file - it would normally take your request, attempt to read the file from the filesystem and send it straight back to your browser. When you've got some code like Wordpress sitting in-between your browser and the file you want you can get it to do those funky things.... but it incurs extra overhead on the web server for every request.

My collection database and technical wiki:
https://www.target-earth.net

Reply 2 of 5, by 133MHz

User metadata
Rank Oldbie
Rank
Oldbie

I know it's Wordpress doing the resizing when I pass the "?w=" parameter after the filename, and I do the linking to the full-size image manually by using the resized img tag inside a url tag pointing straight to the same file without the resizing parameter, so that the small image itself becomes the hyperlink to the big one.

I've used this feature of Wordpress since 2009 on several "BBCode-speaking" forums to provide "click to zoom" images from my personal blog that don't break the layout and don't take forever to load (like the automatic scaling most forums have) in my posts. It's very convenient since as you said, the resizing is done server-side so it saves time and space by not having to upload/update two different files for each picture, and it has never failed me once. But for some reason it doesn't work properly here, and if I just use the full-sized image it doesn't get scaled down so it looks terrible and breaks the layout.

Here's an example from other forum I'm in:
http://www.famicomworld.com/forum/index.php?t … g92252#msg92252

I'm writing a long post with lots of images right now so if there's a way to get a dinamically resized Wordpress image to display as such it'd be great. HTML seems to be disabled (probably for good reason) so I don't know what else I could try. If it's not possible I'll just have to omit pictures in my post and just link to them, since I don't want to break the forum and be disrespectful of people with low bandwidth connections.

Thanks!

http://133FSB.wordpress.com

Reply 3 of 5, by VileR

User metadata
Rank l33t
Rank
l33t

this forum is simply running on an old version of phpBB - the URL parser just isn't terribly advanced, and paramater strings within [img] can make it choke... neither can it do things like automatic resizing when the image is too large.

personally I don't find it a big deal to upload small versions for a batch of images, the process is a few clicks depending on your tools. Or, you can use a proper image hosting service that does that for you on the fly (I like imgur.com).

[ WEB ] - [ BLOG ] - [ TUBE ] - [ CODE ]

Reply 4 of 5, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Yes, best use imgur or imageshack or whatever which do either automatic resoze or give you a thumbnail link to include instead of the original picture. This old forum just can't handle it otherwise..l

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 5 of 5, by 133MHz

User metadata
Rank Oldbie
Rank
Oldbie

I guess I got a bit upset because I've been doing it like that for years on several different forums running on different platforms and it never failed before, so I had my pictures uploaded and my whole post nicely formatted as usual, everything ready to go but when I clicked preview for the final proofreading I noticed that none of the images would render, so I thought I was doing something wrong or hitting some kind of restriction, but now I know it's not as universal as I thought of. Live and learn.

I ended up batch resizing / re-uploading smaller versions of the pictures and modifying my post, every single instance. Not fun, but it works. 🙄

By the way here's the post in question: Trashpicked IBM PS/2 Model 25 Restoration
Now that I think of it, I may have gone a bit overboard with the pictures. 😅

Thanks for your help guys, I totally understand. 😀

http://133FSB.wordpress.com