Change thumbnail crop position in functions.php


I’ve set some custom image sizes in my functions.php using:

if (function_exists('add_image_size'))...

I’d like to know if there’s a way to change the crop start position for these images? Using this…

add_image_size('package-archive-thumb', 200, 150, true);

…means that the original image is scaled proportionately to either the max width and/or height, and cropped from the centre of the image out. I would like to change the crop start position to the top-left corner.

Is this possible?

Thanks in advance.

Are you talking about the image gallery/handler when you add a new image to a post?

Hey Rguy,

Umm… See, I’m not sure. I hardly ever use the inherent image handler in Wordpress admin. Let me try to explain a bit further…

I set a series of custom image sizes in functions.php - for varying content / post-types, and their respective archive and single views using the code I mentioned above.

Then in my respective theme templates (inside the loop), I call on those sizes to display the relevant sized thumbnail for either archive or single view, like so:

<?php the_post_thumbnail('package-archive-thumb'); ?>

The content editor never needs to set the featured image / thumbnail size, as it’s all set in functions.php, and called on in the loop.

I just want to be able to set the crop start point in functions.php…

Thanks for clearing that up, unfortunately I don’t see any specs on moving the crop spot. I am sure you looked at: Function Reference/add image size « WordPress Codex. This plugin may do something you’d want, but there isn’t much info on it: [url=]WordPress › thumbGen « WordPress Plugins

Yeah, I’ve looked in all of the usual places, but seems as though this cannot be done… At least not through functions.php. A lot of people are suggesting changing co-ords in media.php (located in wp-includes), but that’s a hack that I’m not interested in.

Yeah - to be honest, I didn’t dig much but you would need to hack that file, or add onto a plugin that mods that file.