Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: Sir Osis of Liver on January 04, 2018, 05:52:12 PM

Title: Problem posting images
Post by: Sir Osis of Liver on January 04, 2018, 05:52:12 PM
Having an odd problem posting images from external links on my 2.0.15 production form, same on test install.  Image is 484x552px jpg, it's displayed initially as 600x982, reverts to 484x552 when clicked on, back to 600x982 when clicked again.  A second image in same post is 397x650, displays as 484x552 initially, 397x650 when clicked.  Same thing happens if both images are in same post, or just one.  Two other jpgs in same batch display normally.
Title: Re: Problem posting images
Post by: Aleksi "Lex" Kilpinen on January 04, 2018, 06:02:55 PM
Are the images something you could link here? I'm curious to know how they differ from others, as that would seem like SMF incorrectly interpreted their size when posting, and resized them to be smaller - but in fact made them bigger instead.

( I'm guessing your set limits for image sizes are 600 x 650 in
  Admin -> Configuration -> Features and options -> Layout -> Max width/height of posted pictures )
Title: Re: Problem posting images
Post by: Sir Osis of Liver on January 04, 2018, 06:39:10 PM
I edited four images from same batch, you can see them here (http://www.thekrashsite.com/smf20/index.php?topic=25.msg145#msg145).  First and last are distorted til you click on them, second and third display normally.  Max width and height are both set to 0.
Title: Re: Problem posting images
Post by: Aleksi "Lex" Kilpinen on January 05, 2018, 01:07:45 AM
Ok, that is odd. I was going on instinct with that resizing issue, and it does look like I was partly right even though you don't have the limits set.
The source code reveals that they are indeed handled as BBC resized.


<div class="post">
<div class="inner" id="msg_145"><div align="center">
<img src="http://ring4a.jpg" alt="" width="484" height="552" class="bbc_img resized" /><br /><br />
<img src="http://ring2a.jpg" alt="" width="600" height="648" class="bbc_img resized" /><br /><br />
<img src="http://ring3.jpg" alt="" width="345" height="352" class="bbc_img resized" /><br /><br />
<img src="http://ring1.jpg" alt="" width="600" height="982" class="bbc_img resized" /><br /><br /><br /></div></div>


Did you use just IMG or is there attributes for size in the BBC?
A plain IMG embed should use class="bbc_img" if the image is left untouched and no sizelimits are met.

I also tested these exact same images on my own board, and without the size limits set they worked normally.
With 640x640 limits the first two (4 and 2) were resized, but seemed to work normally.
Title: Re: Problem posting images
Post by: Sir Osis of Liver on January 05, 2018, 11:55:39 AM
BBC is adding size attributes.  Oddest thing is first image has been resized to natural size of fourth image.  I've posted first image in two subsequent posts, first one has same problem, second one was posted after clearing browser (IE11), it's displayed correctly.  All four images display correctly in gallery.
Title: Re: Problem posting images
Post by: Aleksi "Lex" Kilpinen on January 05, 2018, 12:01:57 PM
What mods might you have that affect BBC or Image handling?
Title: Re: Problem posting images
Post by: Sir Osis of Liver on January 05, 2018, 12:05:11 PM
The link is to a clean install.  It also happens on one of my production forums, which is different setup.  I've posted multiple images before abd never seen this.  Only difference is both installs are 2.0.15.  Can you duplicate the problem?
Title: Re: Problem posting images
Post by: Aleksi "Lex" Kilpinen on January 05, 2018, 12:09:24 PM
That is why asked about mods, I was unable to replicate the issue on my own production forum.
I will test again on a clean install though, since I am curious about this.

Do you use the image proxy by the way?
Title: Re: Problem posting images
Post by: Sir Osis of Liver on January 05, 2018, 12:21:21 PM
No, unless it was default enabled by upgrade.  Where's the setting?

n/m, proxy is disabled.  Going offline, will tinker with it tonight.
Title: Re: Problem posting images
Post by: Aleksi "Lex" Kilpinen on January 05, 2018, 12:24:11 PM
Ok, that's one thing where we differ - I'll test without it next.
Title: Re: Problem posting images
Post by: Aleksi "Lex" Kilpinen on January 07, 2018, 07:50:36 AM
Tried with a fresh 2.1 without SSL, image proxy or size restrictions

Got this

<div class="inner" data-msgid="3" id="msg_3">
<img src="http://www..com/pics/ring4a.jpg" alt="" class="bbc_img"><br>
<img src="http://www..com/pics/ring2a.jpg" alt="" class="bbc_img"><br>
<img src="http://www..com/pics/ring3.jpg" alt="" class="bbc_img"><br>
<img src="http://www..com/pics/ring1.jpg" alt="" class="bbc_img"></div>
</div>


Tried with a very slightly modified 2.0.15 with SSL and image proxy, and no image size restrictions


<div class="inner" id="msg_122659">
<img src="https:///smf/proxy.php?request=http%3A%2F%2Fwww..com%2Fpics%2Fring4a.jpg&hash=84fb577b69199d18fd0c63d2204b675e" alt="" class="bbc_img" /><br />
<img src="https:///smf/proxy.php?request=http%3A%2F%2Fwww..com%2Fpics%2Fring2a.jpg&hash=09825f5a7844c0a604d5f834b2238733" alt="" class="bbc_img" /><br />
<img src="https:///smf/proxy.php?request=http%3A%2F%2Fwww..com%2Fpics%2Fring3.jpg&hash=967a5b4d6ffd5b3da2a5a6185ee29b72" alt="" class="bbc_img" /><br />
<img src="https:///smf/proxy.php?request=http%3A%2F%2Fwww..com%2Fpics%2Fring1.jpg&hash=bcd0dfcf236fbfb4c0dea58e29658025" alt="" class="bbc_img" />
</div>


I can't seem to replicate the issue on my server. Something in your SMF install is making all the images appear resized though.
Normally IMG tags don't put out a clickable image, and don't use the  bbc_img resized class - your's does for all of them:


<div class="inner" id="msg_145">
<div align="center">
<img src="http://www..com/pics/ring4a.jpg" alt="" width="484" height="552" class="bbc_img resized" /><br /><br />
<img src="http://www..com/pics/ring2a.jpg" alt="" width="600" height="648" class="bbc_img resized" /><br /><br />
<img src="http://www..com/pics/ring3.jpg" alt="" width="345" height="352" class="bbc_img resized" /><br /><br />
<img src="http://www..com/pics/ring1.jpg" alt="" width="600" height="982" class="bbc_img resized" /><br /><br /><br />
</div></div>
Title: Re: Problem posting images
Post by: Sir Osis of Liver on January 07, 2018, 03:32:49 PM
If you look at the last two posts, same image, first was resized incorrectly, second was posted after clearing IE11, was not resized and displays correctly.  Something different in 2.0.15 seems to be confusing bbc and/or browser.  Will try this in FF, see what happens.  This is a clean install, reloaded it fairly recently, but I'll do that again.


Bizzarely, I can't reproduce the problem either. :o  No resize on fresh 2.0.15 install, or on production forum where I originally saw the problem.  Same pics, same code, works fine now in IE11.  Only thing I can figure is all my attempts to post these images originally on both installs were in same browser session, but don't have a clue what could cause this.

 
Title: Re: Problem posting images
Post by: Aleksi "Lex" Kilpinen on January 08, 2018, 05:23:48 AM
Quote from: Sir Osis of Liver on January 07, 2018, 03:32:49 PM
Bizzarely, I can't reproduce the problem either. :o  No resize on fresh 2.0.15 install, or on production forum where I originally saw the problem.  Same pics, same code, works fine now in IE11.  Only thing I can figure is all my attempts to post these images originally on both installs were in same browser session, but don't have a clue what could cause this.

Only getting weirder then. :o

Ok, let's try to narrow down things - What browser were you on when you made the original post?
Did you use Quick reply or the full Post template?
Are you using Wysiwyg editor or not?
Title: Re: Problem posting images
Post by: Sir Osis of Liver on January 08, 2018, 11:58:41 AM
Always use IE11, wysiwyg disabled, usually post with quick reply, but I was in/out editing the post.  I believe the initial post was borked, and when I moved over to test install got same result, and was able to duplicate it in subsequent posts.  Clearing the browser seemed to fix it, and when I went back to production forum and reposted, everything's normal.  The thing that makes no sense is that the first image was resized to the natural dimensions of the fourth image, you can see that in the test post.  Don't see how it could be browser related, resizing is done by code, not browser.
Title: Re: Problem posting images
Post by: Aleksi "Lex" Kilpinen on January 10, 2018, 01:22:23 AM
I will try and experiment with different setups, if I come up with anything I'll let you know. But at the moment I must say this sounds like a very odd issue that I haven't seen before.
Title: Re: Problem posting images
Post by: Sir Osis of Liver on January 10, 2018, 11:41:03 AM
Is the resizing done by javascript?  That could possibly make it a browser issue.

Title: Re: Problem posting images
Post by: Aleksi "Lex" Kilpinen on January 11, 2018, 05:42:57 AM
Right now I don't think it is the actual resizing that is the problem. It is the image handling and BBC parsing, since the width and height attributes are added to the BBC.