• Resolved henrik.haugberg

    (@henrikhaugberg)


    Hi. I just installed a self-hosted www.remarpro.com installation, and imported the content from an existing WordPress.com blog. It worked well, except one thing.

    The images from the old blog are large. Most of them are 5-10 MB, and they are displayed in full size on the blog, just scaled down in css, making the site extremely slow. Even in the media library in WP Admin, the thumbnails are css-scaled versions of the full size original images.

    I thought it might be the import that did not scale or something, but new images I upload have the same problem. On the WordPress.com installation, I see that the images are scaled with query parameters in the image urls, like …jpg?w=720&h=426&crop=1 (both in wp admin and frontend). In the self-hosted (WP 4.3) installation I just set up, theese query parameters are not added to urls, and if I try to open an image directly and add theese parameters to the url manually, it does not scale down the images.

    I have found a bunch of image optimizing plugins, but they just take the full size images and strip away information, set higher jpg compression or other methods to lower the file size by a few percents. Thats not what I want. I want the original full size images to be there for various future uses (like if I change theme to something that needs to show larger images) and then I want the system to scale like described in the WordPress.com installation.

    How can I get the scaling on my self-hosted site the same way it works on WordPress.com?

Viewing 15 replies - 1 through 15 (of 22 total)
  • You want to retain the image quality while doing that ?

    Thread Starter henrik.haugberg

    (@henrikhaugberg)

    Yes. I want the original image in the media library, but scaled images to be displayed.

    When an image is displayed in a post, in a 800px wide container, there is no point displaying my original 6000×4000 px image from the camera. However, i don’t want the images in the media lib scaled down to 800px, because if I later decided to change template to one where the container showing posts is 1200px wide, I don’t want the images to be scaled up from 800 to 1200, as that will not look good. So I want the originals in the lib, and scaled to the required size when being displayed.

    Most CMS do this automatically (at least the last 5-10 years) and most of them in any size, not just a couple of predefined sizes. WordPress.com work this way (with the query params mentioned in my the first post), but I have not found out how to get this feature in the self-hosted WP 4.3 I just set up.

    If I am not wrong, You want original image to stored but while displaying you want it to be scaled down version of image for site speed. I believe plugins can do that. by the way could you post your site address?

    Thread Starter henrik.haugberg

    (@henrikhaugberg)

    https://www.greenfork.no/ (the old one, wp.com)

    Kindly post the .org version of your site

    Thread Starter henrik.haugberg

    (@henrikhaugberg)

    https://178.62.170.79/

    Here are an image from the .com site: https://greenforkblog.files.wordpress.com/2015/08/img_6513-r2.jpg?w=720&h=426&crop=1
    If you change the w/h query params, WP scaled the image based on the high res original.

    On the .org site, the blog show this url without query parameters: https://178.62.170.79/wp-content/uploads/2015/08/img_6513-r2.jpg

    If I try to add them manually, I still get the full res image.

    Is there s plugin that fix this (without having to add the query params manually) that is preinstalled on WordPress.com sites?

    Thread Starter henrik.haugberg

    (@henrikhaugberg)

    Doesn’t that just resize the original image?

    Scaling i images on the fly by query parameters is kind of basic functionality. Anyone know why this feature works by default on WP.com and not on WP.org?

    You can do that will css, for example

    img {
    height:500px;
    width:500px
    }

    before doing adding anything make sure you have a backup copy of your site.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Anyone know why this feature works by default on WP.com and not on WP.org?

    They are different software, you cannot ask that for any feature available on WordPress.com.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    To clarify, the default installation of WordPress does actually create different sized images from your original image when you upload it. People have also made plugins that enhance that.

    I’m not sure why you think differently?

    Thread Starter henrik.haugberg

    (@henrikhaugberg)

    You can do that will css, for example

    img {
    height:500px;
    width:500px
    }

    That’s exactly what I want to avoid. That makes the browser load the whole original file, and just scale down in the client side. Since that even happens in the WP admin media library now, the whole browser almost stop working when I open the media lib, because it is so much data to transfer, and so much to scale down in the browser. I want the server to scale the image, so the client can download the scaled version, making the transfer size much smaller.

    To clarify, the default installation of WordPress does actually create different sized images from your original image when you upload it. People have also made plugins that enhance that.

    I’m not sure why you think differently?

    I have a clean 4.3 installation, and it does not scale my images. I uploaded an image to the media library in WP admin, and it is displayed with the original size everywhere, even in the small thumbnails in the media library. Just scaled down with css, see screenshot: https://imagizer.imageshack.us/a/img905/9968/p53uBS.png

    So if the software are different, I guess the question can be changed to: Does anyone know any plugin that make it possible to have images resized serverside to any size based on query parameters, similar to how it is done in WP.com installations?

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    I have a clean 4.3 installation, and it does not scale my images. I uploaded an image to the media library in WP admin, and it is displayed with the original size everywhere, even in the small thumbnails in the media library. Just scaled down with css, see screenshot: https://imagizer.imageshack.us/a/img905/9968/p53uBS.png

    But you’re looking at a theme, a theme changes the goalposts entirely. Themes can be built to do what they want with images.

    Have you looked at the ‘uploads’ folder when you upload an image? It should be in multiple sizes.

    Thread Starter henrik.haugberg

    (@henrikhaugberg)

    But does the theme change how images work when uploaded directly in the media library in backend? Like I said, even the media library css-scale the original images instead of showing thumbnails (see my screenshot from previous post)

    I checked the server now, and in the wp-content/2015/08 directory, there is only one version of each image, the original. What could be the reason why WP does not make variants of the images?

    Thread Starter henrik.haugberg

    (@henrikhaugberg)

    This is in norwegian, but I that should not be a problem. It is the WP config for the media library. Is there any other configuration that could cause WP not to generate the variants of uploads?

    https://imageshack.com/a/img909/352/Po0Nmz.png

Viewing 15 replies - 1 through 15 (of 22 total)
  • The topic ‘Automatic scaling of images’ is closed to new replies.