Author Topic: Shrink photos on web page  (Read 1429 times)

Shrink photos on web page
« on: 14 April, 2018, 05:23:19 pm »
Is it possible to make photos appear smaller on  a web page without changing the text size?

On some forums, people put a  photo in their post but it's at 100% full size, like 5,000 pixels wide. And the text goes all the way across and you have to scroll about 5 times to read it. Zooming out can make the photo smaller but the text goes smaller by the same amount so ends up unreadable.


woollypigs

  • Mr Peli
    • woollypigs
Re: Shrink photos on web page
« Reply #1 on: 14 April, 2018, 06:19:05 pm »
Yes it is possible. Also depends on how the website/forum works. Some can resize it for the person who is sharing, other needs the person who shares it either to upload the photo in a smaller format or enter the smaller dimension.
Current mood: AARRRGGGGHHHHH !!! #bollockstobrexit

Kim

  • Timelord
    • Fediverse
Re: Shrink photos on web page
« Reply #2 on: 14 April, 2018, 06:25:19 pm »
Anything relying on the person embedding the image doing the right thing isn't going to work, because there are always going to be lazy and computer illiterate people.  The ones who care and know what they're doing are already resizing them.

If there's a client-side solution, it'll be a browser extension.  Someone must have written one for arbitrary zooming of images...

JennyB

  • Old enough to know better
Re: Shrink photos on web page
« Reply #3 on: 14 April, 2018, 06:41:39 pm »
I think hubner is asking if the viewer can do something. The answer AFAIK, is no - unless your browser allows you to not display images.
Jennifer - Walker of hills

Re: Shrink photos on web page
« Reply #4 on: 14 April, 2018, 08:36:03 pm »
Yes, I mean for the viewer.

Re: Shrink photos on web page
« Reply #5 on: 15 April, 2018, 10:44:00 am »
Yes, you can do this with CSS (Cascading Style Sheets).

Create a text file with this in it:
Code: [Select]
img {
    max-width: 50% ! important;
}
You can use a size in pixels instead, eg 200px instead of 50%.

Then set the browser to use the style sheet (instructions) and no image will be bigger than the size you have set.

Note: this will affect all images on all sites, if you want to be more specific that is possible too.
Quote from: tiermat
that's not science, it's semantics.

Re: Shrink photos on web page
« Reply #6 on: 15 April, 2018, 11:26:14 am »
Actually, using a percentage is sub-optimal, it is the percentage of the enclosing box. Either use a specific size in pixels, or something like 80vw which is 80% of the viewport width (but won't work on older browsers).
Quote from: tiermat
that's not science, it's semantics.

Re: Shrink photos on web page
« Reply #7 on: 15 April, 2018, 06:46:43 pm »
If there's a client-side solution, it'll be a browser extension.  Someone must have written one for arbitrary zooming of images...
To comment on this, we'd need to know which browser Hubner is using.

Re: Shrink photos on web page
« Reply #8 on: 15 April, 2018, 07:13:52 pm »
I'm using Waterfox, based on pre-57 Firefox, ie without the new system of add-ons.

I've had a look around, there are some add-ons that allow custom style sheets.

At  the moment: view>page style, gives two choices; basic page style and no style. No style is useful sometimes when the page doesn't display properly because I have javascript turn off.

Ideally I would to be able to have more choices, eg one where images get resized to a preset maximum.

I'll try some of the add-ons and see what they're like.