Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I want to make a crop on the images of my blog page that have more than 443px adjust it to 645x443 size, exactly.

I used this code:

add_theme_support ('post-thumbnails');
add_image_size ('blog-page', 645, 445, true);

However, the image is resized instead of making the crop.

Exemples:

Original image: http://img843.imageshack.us/img843/6444/56004879.jpg

How is: http://imageshack.us/scaled/landing/809/53926495.png

How i want: http://imageshack.us/scaled/landing/823/32122755.png

How do I do this?

share|improve this question

2 Answers 2

up vote 0 down vote accepted

From this comment:

Sry, i forgot it, but i want size of 645x445, exactly, and that image dont have it. The width of it is 588px. Look: img201.imageshack.us/img201/4728/40405258.png Wordpress need make a zoom on it.

WordPress does not zoom. It only crops. If you want an image to have a custom intermediate size, then you must upload an image with dimensions greater than or equal to the dimensions specified in your add_image_size() call.

Also: if you have uploaded images prior to adding your add_image_size() call, then you will need to regenerate your intermediate image files in order for WordPress to create images using your custom size.

share|improve this answer
    
Thanks chip, your answer was right too! :) –  Chead Feb 16 '13 at 19:31

For all the people who've:

  1. registered the sizes in their functions.php
  2. set them in a callback for after_setup_theme with the add_action function
  3. installed Regenerate Thumbnails
  4. installed php5_gd and restarted the server

You may have to manually configure the loading of the extension, if it wasn't for you.

First, check if GD is actually enabled as an extension. Run this snippet in a .php file on the browser to find out:

<?php if (extension_loaded('gd')) 
     { 
         echo "gd loaded"; 
     } else { 
         echo "not loaded"; 
} ?>

If it comes up with "not loaded", the solution found was adding the line:

extension=gd.so

to the apache2/php.ini file.

share|improve this answer
    
Edited. I hope that helps! –  lintuxvi Mar 6 at 6:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.