Wedge
Public area => The Pub => Features => Topic started by: Arantor on March 8th, 2012, 03:56 PM
-
Right now we have the ability to limit the image size of images posted via the img tag, to ensure they're not made huge.
E.g. if you try and post a massive photo but the settings say 150x150, you get a 150x150 size shown (though it doesn't actually resize/thumbnail the image, it just shows it at that size)
What I'm wondering is whether it might not be a bad idea to indicate that the picture isn't full size in those cases and have it automatically link back to the full size image - or even make use of Zoomedia to do that?
-
We sure could... Actually I thought it already had this "click img" system...? Wasn't it in theme.js or somewhere?
-
I just tried it and nothing happened that I could see, anyway... but I did it quickly, didn't check for errors, so it's entirely possible there is something already.
-
Just seems so logical to me... Such a no-brainer...
-
I would also note there are several SMF mods centered around doing the exact same thing with Highslide etc. so it would be good for us to do something similar in the core using the facilities you already made ;)
-
Yeah. The problem with highslide is the license agreement.
Zoomedia emulates its feature set pretty well but it still needs some work.
-
I like the idea here as well... usually when images get resized they seem all blurry to me so anything that can expand to full-size is a plus to me
-
We sure could... Actually I thought it already had this "click img" system...? Wasn't it in theme.js or somewhere?
I know I sneaked that into the 2.0 RC3 release a long time ago. Assuming you kept it whilst rewriting the lot to use jQuery, of course.
Replacing it with Zoomedia sounds like a good idea to me.
-
This is definitely the code in theme.js, as modified for jQuery in Wedge:
// Toggles the element height and width styles of an image.
$('img.resized').css('cursor', 'pointer').click(function () {
this.style.width = this.style.height = (this.style.width == 'auto' ? null : 'auto');
});
-
Hmm, in my test I noticed the .resized was added but clicking on the image did nothing, nor was it with a different cursor.
Would be nice to have Zoomedia on it though, for that extra bit of polish.
-
Dunno. Anyone?
-
Instead of worrying about whether it's broken or not, heh, I'm not exactly familiar with Zoomedia. What would I have to do to apply it to something?
-
I'm afraid I don't remember... :lol:
It's all in AeMe. I'm sure we can cook up a version that works outside of it. (Well, technically it does, for picture embeds. I just don't remember where I'm doing the add_js stuff, ahah...)
No, seriously, Zoomedia was a nightmare to develop. It was done faster than many of the 'nightmares' I worked on, but it was enough of a hassle to encourage me to just leave it be instead of working on adding support for slideshows and video embedding.
-
Well, if it were expected to be used generally, it might be a candidate for inclusion into script.js, then it's just a matter of calling it?
-
Used generally = on every page...
If we use it only for resized attachments, then it's not every page. How many topics does Wedge.org have with a selection of screenshots and other items that would require resizing...? Not many.
Considering zoomedia.js is half the size of sbox.js, that would mean adding at least one kilobyte to the script file, for a feature that's not used everywhere, unlike our select boxes...
So, I would recommend against it.
An extra hit for every page that has a resized image is perfectly acceptable, especially considering caching, and the fact that the image itself already represents an extra hit... ;)
-
I suppose that provided we perform the injection of zoomedia.js in place of the current code (i.e. doing the inclusion once we hit such an image) we would retain that benefit...
-
That's exactly what AeMe does when it embeds an item -- but it makes me think, we have to do the change in the database, don't we...? Because it's in the img bbcode... The PHP code... Oh my... I hate that :P
-
Oh, yes, yes it is. That's why I asked what it would take to make it work because I'll sit and do it for you ;) I just don't know enough (anything?) about Zoomedia's internals and figured you'd be able to point me in the right direction.
-
Hmmm... Basically, it would take this to work:
global $context;
loadSource('media/Aeva-Subs-Vital');
$context['header'] .= '
<link rel="stylesheet" href="' . add_css_file('zoom') . '" media="screen">' . aeva_initZoom(false);
The false is for autosize, which is currently not implemented. There's an additional param where you an set the outline type (array('outline' => 'black') for instance), or an expand delay ('expand' in milliseconds).
I think it should work... But please check first :)