WordPress.org

Ready to get started?Download WordPress

Forums

Disabling image compression in the theme (5 posts)

  1. word-wiz
    Member
    Posted 2 years ago #

    Hi, I have setup a website to display high quality photos that are fully processed outside of wordpress and optimised for size also.

    I do not want wordpress to compress the images uploaded, they do not need it.

    I have modified the core files to change 90 to 100 in

    wp-admin/includes/image-edit.php
    wp-admin/includes/image.php
    wp-includes/media.php

    But when upgraded this is overwritten. Can this change be made in functions.php that will avoid changing core files? I do not want to use a plugin if I can help it.

    Is it as simple as putting the following in functions.php

    'function filter_image_quality() {

    $image_quality_value = 100;

    return $image_quality_value;
    }'

    Thanks for any help.

  2. esmi
    Forum Moderator
    Posted 2 years ago #

    Do not modify WordPress core files.

    I do not want wordpress to compress the images uploaded

    Why? Beyond "they do not need it"?

  3. word-wiz
    Member
    Posted 2 years ago #

    Hi esmi,

    Files are optimised in photoshop and lightroom before import. Why would you want to further compress a file when it has been made the right size and quality for the website.

    I think wordpress should not hardcode the 90% into the core files but make it an option with a caution about quality and loading times.

    I do not want to modify core files whic is the reason for the post.

  4. esmi
    Forum Moderator
    Posted 2 years ago #

    Try http://wordpress.org/extend/plugins/add-from-server/
    Perhaps it will bypass the compression step.

  5. word-wiz
    Member
    Posted 2 years ago #

    Hi Esmi,

    Yep, looks promising - might need some user education on FTP - will test this out.

    Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic