Pages: (3) 1 2 3  ( Go to first unread post ) Add ReplyNew TopicNew Poll

 Edit: Proper Image-Scaling
#
Omnizoa,

Based on what you are saying, if I were to attach a REALLY long image that didn't meet the height maximum, that image would not be shrunk. I am going to attach an image like that and use the image tag and see if I can recreate this problem.

user posted image
Attached Image

As you can see, even though not both dimensions are hit, it still resizes correctly. I think that you might have to go into the Topic, Post, and Polls setting and check on your dimensions.

This post has been edited by GMaster479: May 23 2012, 02:16 PM

Attached 1 File(s)

signature
user posted image
#
No, I've already said that works.

Try posting an image that's X dimension is greater than the X restriction, and it's Y dimension is greater than the X restriction, but lesser than the Y restriction.

For my board, the exact parameters are thus:

The restrictions are 682 (X) by 898 (Y).

This should allow the board to automatically resize anything down to scale and fit the width and length restrictions above.

But here's what happens:

I post an image that is 750 by 384. It resizes properly.

I post an image that is 750 by 585. It resizes properly.

I post an image that is 750 by 989. It resizes properly.

I post an image that is 750 by 787. It DOESN'T resize. The page stretches.



ALSO: Resizing does not behave the same with UPLOADED files as EXTERNAL files, which is what I'm using here.


EDIT: Sorry for the edits after you've started reading, I'm just trying to be as clear and accurate as possible.

This post has been edited by Omnizoa: May 23 2012, 03:17 PM
#
ahhh, I see what you mean now. Jcink's default setting is 600x600 so it would be impossible to do that on this board. I would set it to 650x650 currently to stop board stretching, but Jcink should be able to fix this, though I am sure the if and statements will be hell to deal with.

signature
user posted image
#
QUOTE
ahhh, I see what you mean now. Jcink's default setting is 600x600 so it would be impossible to do that on this board.


Yeah, that's what I suspect.


QUOTE
I would set it to 650x650 currently to stop board stretching


Unfortunately this is very much a convenience factor for my users. Too small and the images become unreadable without opening them in a new window.

It's better that they can read most of the images as is and only have to link to a couple because they otherwise pagestretch, than link to them all.
#
I see what you mean, but if you set it to say...682x682, the extra 216px of height will be almost negligible as far as people reading inline images. I agree this needs to be fixed not just for your situation but because Jcink seems to hate rectangles. However I would look to doing this for now since Jcink might not be able to fix this as quickly as you would like.

signature
user posted image
#
I suppose you're right.

Though that doesn't help with my 750 x 1393 images...
#
QUOTE (GMaster479 @ May 23 2012, 02:49 PM)
I am sure the if and statements will be hell to deal with.


Yeah. I've been reading over this topic and I understand the problem now; but the solution... eh. The issue is going to be really hellish for me to try to patch.

The source to the resizer wasn't written by me either, it was written by one of our former staff. This is it if anyone's curious:

http://files.b1.jcink.com/boardservice/html/resize.js

I don't really have time right now to take a crack at this with a lot of other issues going on. :\ Perhaps GM's suggestion is the "best" for the moment.

signature
email: admin@jcink.com :: blog: John C.
#
QUOTE (Omnizoa @ May 23 2012, 04:48 PM)
I suppose you're right.

Though that doesn't help with my 750 x 1393 images...


That would still get resized with the new dimensions right? Because it is over X and Y?

signature
user posted image
#
This is manual workaround but for tricky images I use special 2 param type bbcode thumb:

CODE
<a href="(PARAM2)" rel="thumbnail"><img src="(PARAM2)" height="(PARAM1)%" width="(PARAM1)%" /></a>


When used:
CODE
[thumb=50]http://IMGLINK[/thumb]

it creats 50% resized thumbnail for image and links full image version.

Not sure if it helps for you but I thought I'll suggest it. smile.gif
PM
#
QUOTE
That would still get resized with the new dimensions right? Because it is over X and Y?


Yes, but it's unreadable at 682x682.

QUOTE
http://files.b1.jcink.com/boardservice/html/resize.js


Argh! I wish I had learned Javasrcript. I would totally do this myself.

QUOTE
Not sure if it helps for you but I thought I'll suggest it.


Sorry, brainstorm, but I'm looking for the ability to auto-scale-to-fit all image sizes (within reason).

This post has been edited by Omnizoa: May 24 2012, 12:02 PM
#
I'll get it done by tomorrow

signature
ΣAE
The True Gentlemen
#
Jcink I think I have the fix contact me to get the stuff I haven't tested it cause I dont remember any of my testing forums or their information so I'll let you try it out

signature
ΣAE
The True Gentlemen
#
CODE
<script type="text/javascript">
// By VoidPC
var maxWidth = 500;
function imageResizerInit(){
for(var i = 0, a = document.getElementsByTagName('IMG'), b = a.length; i < b; i++){
if(a[i].width > maxWidth && a[i].getAttribute('alt') == "user posted image"){
a[i].onclick = function(){
window.open(this.src);
}
a[i].style.cursor = 'pointer';
a[i].width = maxWidth;
}}}
imageResizerInit();
</script>
Try this instead. Place it below <% COPYRIGHT %>

This post has been edited by VoidPC: May 30 2012, 10:39 AM

signature
Developing Reactions
#
QUOTE (VoidPC @ May 30 2012, 09:37 AM)
Try this instead. Place it below <% COPYRIGHT %>


Excellent, so long as I set my restrictions high enough that fixes the problem for me at least until the default settings are fixed.
#
Posiden5665 sent me his fix and I'll test it as soon as possible.

signature
email: admin@jcink.com :: blog: John C.
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:
Share this topic:
« Next Oldest | Bug Reports | Next Newest »

OptionsPages: (3) 1 2 3  Add ReplyNew TopicNew Poll