• I have spent a lot of time at CODEX reading about images and galleries but I still have no understanding of how images work and interact on WordPress.

    You upload a file. It automatically creates a whole lot of other files. I understand this is for serving the right size file for the right thing.

    I my case, for every single file I upload, the backend will reproduce 8 different files with pixel dimensions listed in the file name. Also, some of these pictures are cropped awkwardly and not reflective of the original image.

    1) Why does it do this? How is it used? What controls this? The theme? How can you control how many are created, and those dimensions?

    2) If I want to recreate the images with more compression, why can’t I simply replace the file via FTP. (I have over 100 files to fix and it is time consuming to replace ALL of them individually.)

    I’ve tried to do this and it didn’t give me the results I expected. I got broken thumbnails. So I reuploaded the file and ended up with all the copies. ARGH.

    A good resource that really explains how it works would be great.

Viewing 6 replies - 1 through 6 (of 6 total)
  • for every single file I upload, the backend will reproduce 8 different files

    In that case, five of them are being specifically created by your theme or a plugin. By default WP only creates the three images of the dimensions configured in Settings -> Media.

    Thread Starter roseba

    (@roseba)

    OK. I already tried to dequeue them and it ended up disabling my formats. In fact, I have not yet been successful in dequeing anything.

    This code I simply tried to change the size of them, but it didn’t work. I’m ok with the size of what I’m seeing on screen at this point. I just don’t want to create so many of these thumbnails.

    I’m posting my entire functions file. The only thing that actually works in it, is the Jetpack.

    <?php
    
            wp_deregister_script('untitled-flex-slider-style');
            wp_deregister_script('untitled-flex-slider-style');
    	wp_dequeue_style( 'untitled-flex-slider' );
    	wp_dequeue_script( 'untitled-flex-slider' );
    	wp_dequeue_script( 'wp_enqueue_scripts', 'untitled_scripts' );
    remove_action( 'wp_enqueue_scripts', 'untitled_scripts' );
    
    /* append jetpack carousel so I can customize my own styles */
    
    function enqueue_carousel_style() {
    	wp_enqueue_style( 'my-custom-jetpack-carousel', get_stylesheet_directory_uri() . '/jetpack-carousel.css', array( 'jetpack-carousel' ), wp_get_theme()->Version );
    }
    add_filter( 'post_gallery', 'enqueue_carousel_style', 1001, 2 );
    
    /* control content width in gallery */
    if ( ! isset( $content_width ) )
        $content_width = 688;
    
    function untitled_setup() {
        global $cap, $content_width;
    
        // This theme styles the visual editor with editor-style.css to match the theme style.
        add_editor_style();
    
        // This theme uses post thumbnails
        if (function_exists('add_theme_support')) {
            add_theme_support('post-thumbnails');
            set_post_thumbnail_size(300, 999);
            add_image_size('slider-large', 1000, 999);
            add_image_size('slider-middle', 756, 999);
            add_image_size('slider-thumbnail', 80, 999);
            add_image_size('post-thumbnails', 222, 999);
            add_image_size('single-post-thumbnail', 598, 999);
        }}

    Also I’m using Jetpack with Mosaic Tiles. Could that be creating so many sizes? The tiles are very dynamic.

    Let’s try an experiment…

    1. Upload an image whilst using the default Twenty Thirteen theme with all plugins deactivated and see how may images are created.

    2. Re-activate just Jetpack and upload another image. Again – count how many are created.

    Thread Starter roseba

    (@roseba)

    OK with Twenty Thirteen, it creates the original plus 3 extra in both scenarios. I guess one can conclude it is the theme.

    I guess how to figure out how to dequeue the sizes I don’t want.

    Where did you download this theme from?

    Thread Starter roseba

    (@roseba)

    It’s an automattic theme. https://www.ads-software.com/themes/untitled
    I’m using a child of it, but I’m not using a few of the features on it. I would love to dequeue them so they don’t add load time.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Media: How it works’ is closed to new replies.