Jump to content
HybridZ

Thumbnail sizes


Jesse OBrien

Recommended Posts

I'm not sure why the decision was made to have such teeny little thumbnails be the default for externally hosted images, but I'm not a fan of it. I looked around and couldn't find a specific setting for thumbnail sizes, so is there some way it could be changed globally? Is there a reason not to?

 

I'd just like to be able to read a thread without having to click images one at a time to be able to view them in context.

Link to comment
Share on other sites

Ratsun is too extreme in the other direction. I'm just looking for ~640px wide images (ideally), which won't affect the loading speed appreciably. I suppose it'd be nice to be able to set on a per-profile basis (so I could have 640px or 800px wide images displayed, and BluDestiny could keep the current 100px indicators that an image might be in the post).

 

Actually, I just double-checked, and you're downloading the 640px version of the image, then client browsers are resizing it down to 100px wide and 100px tall. Pages would actually load FASTER with images set to 640px limits, as you wouldn't have to wait for the images to be re-downsized again after downloading them.

 

Here's the offending code:

 

 


<!-- Forces resized images to an admin-defined size -->

<style type='text/css'>

img.bbc_img {

max-width: 100px !important;

max-height: 100px !important;

}

</style>
Link to comment
Share on other sites

Pm braap, I believe him or superdan do the coding/updates (could be completely wrong). Having the ability to choose what size you want to view would be way better in my opinion.

It may not be an option, I haven't done any backend work in IPBoard before. I'll offer my hand at it, though. I don't imagine writing a plugin would be too difficult.

Edited by Jesse OBrien
Link to comment
Share on other sites

  • Administrators

I do not see a user definable setting for image size in posts.

Besides, could you imagine the size of a topic like this if the default image size was 640px?

http://forums.hybridz.org/topic/97180-luna-the-cause-and-solution-of-all-my-problems/

This an example of why it is set to 100px, it has NOTHING to do with page load times.

Link to comment
Share on other sites

That's a whole lot of images. Call me crazy, but I think I'd appreciate that thread even more if the size were 640px. The images are a part of the story. They were added in to be viewed.

 

That explanation does make sense, though. I'm going to look into plugin authorship for IPBoard. Would you mind sharing what version we're currently using, and is that something that might be considered if I can have it stable in a month or three?

Link to comment
Share on other sites

I just looked around on the ip.board dev section, and it looks like this would be really straightforward to write (closer to 1 month to have it stable than 3). However, to ensure that it's safe and doesn't muck up any existing data (and is easy to throw away when the time comes) it should really create a separate TABLE in the database (rather than appending a separate field to every user). That table would be pretty straightforward, just having a userID (which I would assume to be formatted like 3652-jesse-obrien or just 3652 since I think I can still modify my display name) and a max_size attribute.

 

 

It would essentially search through that custom table for the userid (3652 in my case) and if the userid is found, create a variable of $user_image_max for that session. This is just pseudocode to show the logic, but this is pretty much all it'd take to replace that chunk of CSS dynamically. If someone chose not to set that variable, they wouldn't see any change from how it is now. If the board admins wanted to get rid of the plugin altogether, it would just mean deleting the custom application folder, and/or deleting the new custom table. Either would disable the plugin altogether, but I like removing all traces of a plugin instead of leaving code-dingleberries dangling all over the database.


if [ -d $session.user_image_max ]:

do:

image_sizing = "<style type='text/css'>

img.bbc_img {

max-width: $user_image_max !important;

max-height: $user_image_max !important;

}

</style>"



else:

image_sizing = "<style type='text/css'>

img.bbc_img {

max-width: 100px !important; # or however admins normally change it

max-height: 100px !important; # same as above

}

</style>"

endif
Edited by Jesse OBrien
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...