Page 1 of 1

Default picture size

PostPosted: Sat Mar 18, 2017 3:08 pm
by awilsondc
I've noticed with the new DIY style page creation tool that the default image size when you add a picture from SP is medium. So it uses the medium version rather than original or even large. If you click and drag to make an image larger on the new editor it gets distorted and grainy. I've noticed this, so when ever I want a larger picture I go back and use the old editor, find the code, and replace the word medium with original. Works fine, but it's a bit of extra work. However, not everyone knows about this. A good example is the currently featured trip report by MikeLJ A short day out. Great report, but the pictures are a bit grainy. If you click on one however and go to the original they are nice and crisp. They are grainy on the TR due to dragging to enlarge the "medium" image on the new editor.

Is there a reason medium was used as default? Could this be changed to original? I think this would make some pages look better when people don't know about html code and want to use a larger size image.

Re: Default picture size

PostPosted: Mon Mar 20, 2017 12:34 am
by rgg
I agree that this isn't good, but original as default would be worse: without a fast internet connection it takes a long time to download big originals. At home I have no such problems, but during my travels I do, and if a page takes too long to load I won't read it.

The best solution would be if the editor would be smart enough to select the right image version whenever the image size is changed. However, this is something only site admin could implement, and I have no idea how easy or difficult this is.

The second best solution is something along the line of your own procedure, though it can be done a bit easier. Instead of using the old editor, in the new editor you can switch to HTML mode (use the </> button, the leftmost one on the ribbon right above the text). At the same time, open the trip report in a different window.

Now, for each fuzzy image, look up the id in the trip report, then search for the same id in the HTML code in the editor. You'll find something like "/images/medium/983128.jpg". Now, if you want this image to be a bit bigger, replace "medium" with "large". This is usually fine and it won't slow down loading the page all that much. Only if you want a really image (well over 1024px wide), use "original" and not "large".

Re: Default picture size

PostPosted: Tue Mar 21, 2017 5:37 am
by Josh Lewis
rgg wrote:The best solution would be if the editor would be smart enough to select the right image version whenever the image size is changed. However, this is something only site admin could implement, and I have no idea how easy or difficult this is.


This would be an easy event handler to create. Considering that SP's editor has jQuery built into it, the code would look something like:

Code: Select all
$( ".image, .image-left, .image-right" ).click(function() {
    if($this.children("img").width() > 500 && < 1024) {
        $this.children("img").attr('src',$this.attr('src').replace('medium','large'))
    }
});


Note that I didn't test this, however it should at least be close. 8)