Title: Plugin compatibility with 9999 height setting
Last modified: June 14, 2021

---

# Plugin compatibility with 9999 height setting

 *  Resolved [colmtroy](https://wordpress.org/support/users/colmtroy/)
 * (@colmtroy)
 * [5 years ago](https://wordpress.org/support/topic/plugin-compatibility-with-9999-height-setting/)
 * Hi there,
    A common technique for creating custom WP thumbs where you want a 
   fixed width but with a variable height which respects to original aspect ratio
   is to do somehthing like this: `add_image_size( 'category-thumb', 300, 9999 );//
   300 pixels wide (and unlimited height)`
 * You can see this documented here
    [https://codex.wordpress.org/Post_Thumbnails](https://codex.wordpress.org/Post_Thumbnails)
   and here [https://developer.wordpress.org/reference/functions/add_image_size/](https://developer.wordpress.org/reference/functions/add_image_size/)
 * (search for 9999 )
 * This is a very useful technique but when you use your plugin, the technique fails
   as it ends up generating an image that is 9999 pixels high rather than the variable
   height based on the original image aspect ratio.
 * Can you implement a fix to ignore the 9999 height specifically?
    You’ll see most
   of the core WordPress themes also use the 9999 technique
 * Colm

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [Nabil Lemsieh](https://wordpress.org/support/users/nlemsieh/)
 * (@nlemsieh)
 * [5 years ago](https://wordpress.org/support/topic/plugin-compatibility-with-9999-height-setting/#post-14555254)
 * Hi [@colmtroy](https://wordpress.org/support/users/colmtroy/)
 * That’s because the goal of the plugin is to make images, with different aspect-
   ratio, to fit within a specified width and height dimensions. For example: if
   you register a size with an auto height ( e.g: 300×0 ) the plugin will generate
   a squared image of 300×300.
 * Let me know if you have any questions.
 * Best,
    Nabil
 *  [maintanosgr](https://wordpress.org/support/users/maintanosgr/)
 * (@maintanosgr)
 * [5 years ago](https://wordpress.org/support/topic/plugin-compatibility-with-9999-height-setting/#post-14560382)
 * In our case with a theme using the 9999px method, we ended up having a broken
   gallery with extremely high images and wrong aspect ratio of course. It would
   be great if you could give us an option to ignore the 9999px height specifically
   since it’s so tied to the core documentation.
 *  Plugin Author [Nabil Lemsieh](https://wordpress.org/support/users/nlemsieh/)
 * (@nlemsieh)
 * [5 years ago](https://wordpress.org/support/topic/plugin-compatibility-with-9999-height-setting/#post-14562734)
 * Hi [@colmtroy](https://wordpress.org/support/users/colmtroy/) [@maintanosgr](https://wordpress.org/support/users/maintanosgr/)
 * I was able to reproduce the issue. We’ll make sure to fix it in the next update.
 * Thank you for the report!
 * Best,
    Nabil
 *  Thread Starter [colmtroy](https://wordpress.org/support/users/colmtroy/)
 * (@colmtroy)
 * [5 years ago](https://wordpress.org/support/topic/plugin-compatibility-with-9999-height-setting/#post-14571770)
 * Awesome Nabil 🙂 Looking forward to it!
    Colm
 *  Plugin Author [Nabil Lemsieh](https://wordpress.org/support/users/nlemsieh/)
 * (@nlemsieh)
 * [5 years ago](https://wordpress.org/support/topic/plugin-compatibility-with-9999-height-setting/#post-14583859)
 * We’re shipping the update later this week. In the meantime, you can add this 
   code snippet to your child theme functions.php file under Appearance menu > Theme
   Editor or use the [Code Snippets](https://wordpress.org/plugins/code-snippets/)
   plugin, then regenerate thumbnails:
 *     ```
       function fix_thumbnail_9999()
       {
       	add_image_size('category-thumb', 300, 300, true);
       }
       add_action('after_setup_theme', 'fix_thumbnail_9999', 100);
       add_action('init', 'fix_thumbnail_9999', 100);
       ```
   
    -  This reply was modified 5 years ago by [Nabil Lemsieh](https://wordpress.org/support/users/nlemsieh/).
 *  Plugin Author [Nabil Lemsieh](https://wordpress.org/support/users/nlemsieh/)
 * (@nlemsieh)
 * [4 years, 12 months ago](https://wordpress.org/support/topic/plugin-compatibility-with-9999-height-setting/#post-14598919)
 * Hi,
 * The update is live! Let me know how it goes for you.
 * Best,
    Nabil
 *  Plugin Author [Nabil Lemsieh](https://wordpress.org/support/users/nlemsieh/)
 * (@nlemsieh)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/plugin-compatibility-with-9999-height-setting/#post-14608492)
 * I’m going to mark this as resolved. if you have any further questions, feel free
   to start a new thread.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Plugin compatibility with 9999 height setting’ is closed to new replies.

 * ![](https://ps.w.org/smart-image-resize/assets/icon-256x256.jpg?rev=2142235)
 * [Smart Image Resize - Make WooCommerce Images the Same Size](https://wordpress.org/plugins/smart-image-resize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/smart-image-resize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/smart-image-resize/)
 * [Active Topics](https://wordpress.org/support/plugin/smart-image-resize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/smart-image-resize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/smart-image-resize/reviews/)

 * 7 replies
 * 3 participants
 * Last reply from: [Nabil Lemsieh](https://wordpress.org/support/users/nlemsieh/)
 * Last activity: [4 years, 11 months ago](https://wordpress.org/support/topic/plugin-compatibility-with-9999-height-setting/#post-14608492)
 * Status: resolved