Skip navigation

WordPress Thumbnail Size Limit Hack

WordPress 2.1 Thumbnail Hack from Nick Smit offers a way to get around the WordPress limit of not creating a thumbnail for an image over 3 megapixels.

Since blog images are smaller than this, a 3 megapixel image is huge and unusual for publishing on the web. Most reduce the size, and along with it the file size, so this is not a hack for the average WordPress blogger. It is designed for serious photographers and visual artists hosting huge image files on their blog.

His hack involves changing the code inside of a WordPress core programming file, which is not recommended, but if this is an issue for you, and you remember to change this again when you upgrade, why not give it a try.

Related Articles


Site Search Tags: , , , , , , , ,
Copyright Lorelle VanFossen, member of the 9Rules Network Feed on Lorelle on WordPress Subscribe

Member of the 9Rules Blogging Network

23 Comments

  1. Posted March 28, 2007 at 9:53 am | Permalink

    ah… I thought it is a plugin to set the thumbnail size…

  2. Posted March 28, 2007 at 10:58 am | Permalink

    I use “imagewell” (Mac OS X) to upload and resize the images that i use into my blog. A pretty nice program.

    To present my photograph’s i use other platforms like http://www.fotocommunity.com. It has a possiblility to create an own homepage out of the photos uploaded onto this platform. This homepage can be customized using html and css. So I made this page looking like my blog. I even made the top navigation from my blog avaiable on this page. This way i’m able to melt both pages together. A pretty nice feature :)

  3. Posted March 28, 2007 at 12:54 pm | Permalink

    Few corrections to this post:

    The limitation is not “3 MB” or 3 megabytes in size. The limitation is any picture bigger than 3 megapixels. And yes, by megapixels, I mean exactly the same as your digital camera.

    If you multiply the width of the image times the height of the image, in pixels and come up with a number bigger than 3145728 (3*1024*1024), then WordPress will not attempt to create a thumbnmail for that picture when you upload it.

    Now, his method involves hacking core files to bypass this. Here’s a method that does *not* hack a core file. Put this bit of code into a plugin or into your theme’s functions.php file:

    function raise_image_size_limit() {
    return 8*1024*1024; // or whatever you want
    }
    add_filter('wp_thumbnail_creation_size_limit','raise_image_size_limit');

    Simple. That will raise it to 8 megapixels.

    The problem with doing this is that PHP is memory limited. Most hosts limit the PHP memory to 8MB. Some let you raise it to 16MB or more. When PHP is processing the image, it’s going to use a lot of memory. So if you do raise this limit and try bigger files, you may get an out of memory error. There is not an easy solution for this. See if your host can increase the maximum memory limit for you or tell you how to do it (it can be done in the .htaccess file, or a local PHP.INI sometimes).

    But there you go. Hope that helps somebody. :)

  4. Posted March 28, 2007 at 4:43 pm | Permalink

    Thanks for the clarity. And for making me look again at this post. A few boo boos “slipped” by.

  5. Posted March 28, 2007 at 10:26 pm | Permalink

    Heh, the linked hack is a blank page from here. Mr. Smit should make sure his database is not overloaded and that no plugins are causing him problems.

    (Sorry, this is offtopic)

    I had a similar problem, people would (randomly, it seemed) get blank pages when visiting my blog. Turned out it was an outdated plugin that didn’t play nicely with the upgrade.

  6. Posted March 28, 2007 at 11:50 pm | Permalink

    Thanks for letting me know. I hope the problem is fixed soon. Luckily, Google has a Cached version of the article.

  7. Posted March 29, 2007 at 12:20 pm | Permalink

    Smart to pick such an interesting title but not actually offering something interesting; tons of users want to get a custom thumbnail size, I wouldn’t even want to add a picture of 3MP anyway – browsers will transform it big time.

  8. Posted March 29, 2007 at 7:17 pm | Permalink

    The biggest kink in this whole issue is a php_ini setting called max_input_time. Standard configuration sets this at 60 seconds, which doesn’t leave very much time to upload a large picture file, especially on DSL or dialup. Supposedly it can be changed in an .htaccess file, but I’ve not found a shared hosting company that allows it.

    You can play with PHP memory and write a plugin to increase the max thumb size in WP, but if you don’t have time to upload the file, all is for naught.

  9. Posted March 30, 2007 at 10:30 am | Permalink

    I don’t know about 3MP images, but the 2MP image I took with my N70 didn’t generate the thumbnail. I didn’t realize that WP has this limitation!

  10. Posted March 30, 2007 at 2:26 pm | Permalink

    One additional comment:

    If you use the code I posted in my comment above, and change it to return -1 then that totally disables this limitation. It will then attempt to create a thumbnail for *all* images.

    Just so you know. :)

  11. Posted April 6, 2007 at 3:46 pm | Permalink

    Hey all :)
    Nice to see my post being put to some use :) Sorry about the website downtime – too much playing around with wordpress!
    On another note, I’m still looking for a decent wordpress batch image uploader that will also automatically thumbnail pictures. Something like that which Facebook uses (www.facebook.com).

    Cheers, Nick

  12. Posted April 6, 2007 at 4:13 pm | Permalink

    I don’t know about what Facebook uses, but I listed a lot of batch image uploaders you can experiment with in WordPress Plugins for Images, Photographs, and Graphics.

    And thanks again for the great tip, Nick!

  13. Posted April 26, 2007 at 9:59 am | Permalink

    @Leftblank: Custom thumbnail size?


    function custom_thumbnail_size() {
    return 128; // or whatever you want
    }
    add_filter('wp_thumbnail_max_side_length','custom_thumbnail_size');

    The “128” defines the length of the long side of the image. it will scale the other side to keep the same proportions.

    Note that 128 is the default value. If you want to make it bigger or smaller, just change the value.

    Also, this only affects *new* thumbnails. Your old thumbnails don’t get magically remade by this.

  14. Posted March 1, 2008 at 8:02 am | Permalink

    One thing to be aware of is that the file you need to alter in the newest versions of wordpress isn’t admin-function.php anymore.

    Now it is /wp-admin/includes/image.php

  15. Posted May 2, 2008 at 1:13 pm | Permalink

    You can bypass WordPress thumbnails altogether if you use the Viva Thumbs plugin. You upload an image of any size and Viva thumbs can create all the thumbnail sies you need on the fly. Check out the live demo on my site at http://www.mediatricks.biz/demo

  16. Posted June 3, 2008 at 4:39 pm | Permalink

    Hi, I couldn’t agree more with Tim. I use his plugin on my site and it is a HUGE time saver. I even wrote a quick review on it, and how I have integrated it into my site.

  17. Posted October 24, 2009 at 1:13 pm | Permalink

    I am getting consistent discoloration in all of the thumnail images I upload to my products in the WP ecommerce plugin. All images have a bluish tinge or cast, regardless of the image, all of which are jpeg.

    Thanks!

    • Posted October 25, 2009 at 10:58 am | Permalink

      If it is related to the Plugin, contact the author. However, the odd are that it has to do with your Theme or monitor.

  18. Posted November 27, 2009 at 1:34 am | Permalink

    How does the hack works? can elaborate..

  19. cesi
    Posted March 19, 2011 at 3:04 am | Permalink

    is this possible at PHP 5.3.2 ?, i couldnt set my limits, please help, thank you

    • Posted March 19, 2011 at 8:30 pm | Permalink

      Please contact the author of that post for information and details.

  20. meahbashir
    Posted December 5, 2011 at 4:07 am | Permalink

    One thing to be aware of is that the file you need to alter in the newest versions of wordpress isn’t admin-function.php anymore

  21. Joseph Buarao
    Posted January 15, 2012 at 5:13 am | Permalink

    cool article.. thanks for sharing mate..


86 Trackbacks/Pingbacks

  1. [...] WordPress Thumbnail Size Limit Hack (Source: Lorelle on [...]

  2. [...] WordPress Thumbnail Size Limit Hack (Source: Lorelle on [...]

  3. [...] WordPress Thumbnail Size Limit Hack (Source: Lorelle on [...]

  4. [...] WordPress Thumbnail Size Limit Hack (Source: Lorelle on [...]

  5. [...] 132. 3 WordPress Hacks For SE-Friendly Blog Archives. 133. Opening Links in New Windows. 134. WordPress Thumbnail Size Limit Hack. 135. Restore your WordPress Database. 136. Validating WordPress. 137. Backing Up WordPress. 138. [...]

  6. [...] Page Hacks132. 3 WordPress Hacks For SE-Friendly Blog Archives133. Opening Links in New Windows134. WordPress Thumbnail Size Limit Hack135. Restore your WordPress Database136. Validating WordPress137. Backing Up WordPress138. Getting [...]

  7. [...] WordPress Thumbnail Size Limit Hack [...]

  8. [...] WordPress Thumbnail Size Limit Hack [...]

  9. [...] Limita el tamaño de tus miniaturas [...]

  10. [...] Hack para la imagen en miniatura del limitador de tamaño de WordPress ¿No te gusta la calidad del JPEG en miniatura por defecto? [...]

  11. [...] WordPress Eklenti boyutu limitini kırmak [...]

  12. [...] WordPress Thumbnail Size Limit Hack [...]

  13. [...] WordPress Eklenti boyutu limitini kırmak [...]

  14. [...] WordPress Eklenti boyutu limitini kırmak [...]

  15. [...] Limita el tamaño de tus miniaturas [...]

  16. [...] 45. WordPress Thumbnail Size Limit Hack [...]

  17. [...] 45. WordPress Thumbnail Size Limit Hack [...]

  18. [...] Ajuste para limitação de tamanho do Thumbnail (Fonte: Lorelle on [...]

  19. [...] Limita el tamaño de tus miniaturas [...]

  20. [...] 21. WordPress Thumbnail Size Limit Hack [...]

  21. [...] WordPress Thumbnail Size Limit Hack « Lorelle on WordPress Don’t like the default thumbnail JPEG quality? Change it. [...]

  22. [...] WordPress Thumbnail Size Limit Hack [...]

  23. [...] Limita el tamaño de tus miniaturas [...]

  24. [...] 21. WordPress Thumbnail Size Limit Hack [...]

  25. [...] 132. 3 WordPress Hacks For SE-Friendly Blog Archives. 133. Opening Links in New Windows. 134. WordPress Thumbnail Size Limit Hack. 135. Restore your WordPress Database. 136. Validating WordPress. 137. Backing Up WordPress. 138. [...]

  26. [...] WordPress Thumbnail Size Limit Hack [...]

  27. [...] 132. 3 WordPress Hacks For SE-Friendly Blog Archives. 133. Opening Links in New Windows. 134. WordPress Thumbnail Size Limit Hack. 135. Restore your WordPress Database. 136. Validating WordPress. 137. Backing Up WordPress. [...]

  28. [...] 132. 3 WordPress Hacks For SE-Friendly Blog Archives. 133. Opening Links in New Windows. 134. WordPress Thumbnail Size Limit Hack. 135. Restore your WordPress Database. 136. Validating WordPress. 137. Backing Up WordPress. 138. [...]

  29. [...] 132. 3 WordPress Hacks For SE-Friendly Blog Archives. 133. Opening Links in New Windows. 134. WordPress Thumbnail Size Limit Hack. 135. Restore your WordPress Database. 136. Validating WordPress. 137. Backing Up WordPress. 138. [...]

  30. [...] WordPress Thumbnail Size Limit Hack [...]

  31. [...] 44. WordPress Thumbnail Size Limit Hack (Source: Lorelle on WordPress) [...]

  32. [...] 21.WordPress缩略图尺寸限制修改工具 [...]

  33. [...] WordPress Thumbnail Size Limit Hack [...]

  34. [...] WordPress Thumbnail Size Limit Hack (Source: Lorelle on [...]

  35. [...] 95. WordPress Thumbnail Size Limit Hack [...]

  36. [...] 95. WordPress Thumbnail Size Limit Hack [...]

  37. [...] WordPress Thumbnail Size Limit Hack [...]

  38. [...] 191. WordPress Thumbnail Size Limit Hack [...]

  39. [...] 21.WordPress缩略图尺寸限制修改工具 不喜欢默认的JPEG缩略图质量?修改之~ [...]

  40. [...] 95. WordPress Thumbnail Size Limit Hack [...]

  41. [...] 132. 3 WordPress Hacks For SE-Friendly Blog Archives. 133. Opening Links in New Windows. 134. WordPress Thumbnail Size Limit Hack. 135. Restore your WordPress Database. 136. Validating WordPress. 137. Backing Up WordPress. 138. [...]

  42. [...] WordPress Thumbnail Size Limit Hack [...]

  43. [...] 21. WordPress Thumbnail Size Limit Hack [...]

  44. [...] WordPress Thumbnail Size Limit Hack [...]

  45. [...] WordPress Thumbnail Size Limit Hack [...]

  46. [...] WordPress Thumbnail Size Limit Hack (Source: Lorelle on [...]

  47. [...] Limita el tamaño de tus miniaturas [...]

  48. [...] 21.缩略图尺寸限制修改工具Wordpress [...]

  49. [...] WordPress Thumbnail Size Limit Hack [...]

  50. [...] WordPress Thumbnail Size Limit Hack [...]

  51. [...] WordPress Thumbnail Size Limit Hack [...]

  52. [...] WordPress Thumbnail Size Limit Hack [...]

  53. [...] Limita el tamaño de tus miniaturas [...]

  54. [...] Limita el tamaño de tus miniaturas [...]

  55. [...] WordPress Thumbnail Size Limit Hack (Source: Lorelle on [...]

  56. [...] WordPress Thumbnail Size Limit Hack Don’t like the default thumbnail JPEG quality? Change it. Comments (0)    Posted [...]

  57. [...] 21.WordPress缩略图尺寸限制修改工具 [...]

  58. [...] 21.WordPress缩略图尺寸限制修改工具 [...]

  59. [...] 95. WordPress Thumbnail Size Limit Hack [...]

  60. [...] WordPress Thumbnail Size Limit Hack (Source: Lorelle on [...]

  61. [...] 21.WordPress缩略图尺寸限制修改工具 [...]

  62. [...] WordPress Thumbnail Size Limit Hack [...]

  63. [...] Limita el tamaño de tus miniaturas [...]

  64. [...] WordPress Thumbnail Size Limit Hack [...]

  65. [...] 21. WordPress Thumbnail Size Limit Hack [...]

  66. [...] WordPress Thumbnail Size Limit Hack [...]

  67. [...] 21.WordPress缩略图尺寸限制修改工具 [...]

  68. [...] 95. WordPress Thumbnail Size Limit Hack [...]

  69. [...] Versión independiente)Abre los enlaces en una nueva página por defectoConvierte tu Blog en un CMSLimita el tamaño de tus miniaturasPostea directamente en Del.icio.usCrea un efecto de apertura de hojaSepara comentarios de los [...]

  70. [...] WordPress Thumbnail Size Limit Hack [...]

  71. [...] 17. WordPress Thumbnail Size Limit Hack [...]

  72. [...] Versión independiente)Abre los enlaces en una nueva página por defectoConvierte tu Blog en un CMSLimita el tamaño de tus miniaturasPostea directamente en Del.icio.usCrea un efecto de apertura de hojaSepara comentarios de los [...]

  73. [...] Ajuste para limitação de tamanho do Thumbnail (Fonte: Lorelle on [...]

  74. [...] 95. WordPress Thumbnail Size Limit Hack [...]

  75. [...] 95. WordPress Thumbnail Size Limit Hack [...]

  76. [...] 21) WordPress Thumbnail Size Limit Hack [...]

  77. [...] 95. WordPress Thumbnail Size Limit Hack [...]

  78. [...] Limita el tamaño de tus miniaturas [...]

  79. [...] 95. WordPress Thumbnail Size Limit Hack [...]

  80. [...] WordPress Thumbnail Size Limit Hack [...]

  81. [...] 44. WordPress Thumbnail Size Limit Hack (Source: Lorelle on WordPress) [...]

  82. [...] 95. WordPress Thumbnail Size Limit Hack [...]

  83. [...] WordPress Thumbnail Size Limit Hack [...]

  84. [...] WordPress Thumbnail Size Limit Hack Don’t like the default thumbnail JPEG quality? Change it. [...]

  85. […] WordPress Thumbnail Size Limit Hack […]

  86. […] WordPress Thumbnail Size Limit Hack […]

Post a Comment

Follow

Get every new post delivered to your Inbox.

Join 20,556 other followers

%d bloggers like this: