You can define your own cropping sizes but you can create a function that accepts image size + image position and then load your images accordingly.
For example-
<?php
$size="medium";
$pos = array(
'top' => '100',
'left' => '100'
);
function load_image_with_pos( $img_id, $size, $pos ) {
$img_src = wp_get_attachment_image_src( $img_id, $size );
$new_img = array(
'url' => $img_src,
'size' => $size,
'position' => $pos
);
return $new_img;
}
?>
I hope it helps
Related Posts:
- How To Delete Desired Image Sizes From wp-content/uploads?
- image_resize in wp3.5 change to wp_get_image_editor and wont work
- Why is wp_get_attachment_image_src returning wrong dimensions? [duplicate]
- Stop wordpress from creating multiple size images
- wp_get_attachment_image() not working when trying to add width and height attributes
- WordPress 3.5 – Add custom image size
- Add_image_size not cropping
- Custom image sizes only for thumbnails
- Use ‘medium’ size with catch_that_image() function
- How can I get I get the thumbnail custom size dimensions?
- Is there a way to avoid using add_image_size? Best way to manage images
- How to fit image to Thumbnail canvas size?
- Custom image size mixes width and height in output
- Image Sizes/Thumbnails not generating on local install Ampps
- Best way to manage theme images
- add_image_size cropping changes on Mobile devices
- Thumbnails resized and not cropped in the center
- get_intermediate_image_sizes() returning different values depending on is_admin()
- Media Library Image Sizes in Bones theme (add_image_size)
- Check if custom thumnail size image has been cropped to the correct dimensions
- the_post_thumbnail responsive srcset not populating with custom image size
- get_the_post_thumbnail_url with an unregistered size
- Can WordPress crop only the post thumbnails?
- Autogenerated Thumbnail compression depending on size
- Detect if image file is a thumbnail
- Setting default thumbnails size & creating multiple thumbnail sizes
- Additional image sizes are not being generated
- Media Gallery Upload Thumbnail Compression is Changing Image Hue
- Disable wordpress image sizes generation
- WP 3.4 has missing photo data
- How to disable multiple thumbnail generation?
- Image Quality Thumbnail Compression in WordPress?
- prevent wordpress from creating thumbnails of an image
- How check that there is post thumbnail feature image or not on wordpress?
- How to link to featured image to media file URL
- Open Image Thumbnail in a new page, while clicking on the link
- How to stop thumbnail generation from some images and different size thumbnail generate
- How to stop wordpress always displaying full-res images
- Why are some thumbnails on their side – but correct when I go to edit image? [closed]
- how to link post-thumbnail to original img in a lightbox?
- How to use thumbnail size of image if I’m only using src to get image
- Add padding while generating thumbnail
- Can’t generate thumbnail images
- How to make thumbnails of uploaded animated gifs NOT animated
- “Medium” size image displayed instead of “thumbnail” in only one post, other posts are fine
- How to create resized versions of images added with wp_insert_attachment
- How to have the thumbnail cropping tool working
- Filter for post_thumbnail: link to small src and add data-attribute [duplicate]
- Display number of latest images from wordpress gallery in your homepage
- Why are thumbnails not being generated for PDF files?
- Rebuild thumbnails via WP Cli – how?
- Get an image from url, resize it, and save on a custom folder (not the media library)
- Else/If Statement to Display Photo Descriptions
- Dynamically determine the width and height of a image file to be cropped & uploaded AFTER form submission given fixed aspect ratio
- Thumbnail generating and posting
- Disable Media File Image Link On Mobile Devices
- Timthumb not working with WordPress 4.0
- the_post_thumbnail returns full sized image, how to debug?
- add youtube thumbnail in index and single.php add video
- How to add thumbnails to posts and pages automatically in a uniformed fixed elegant way?
- wp_get_attachment_image_src() with advanced custom fields returning empty
- Broken thumbnails (sometimes) with TimThumb
- Is it possible to save crop to a different size of the image when in image editor?
- The URL of images on my website changed after being set as featured image
- Apply manual image cropping not to thumbnail but medium_large size
- Custom thumbnail crop offsets
- Display Multiple Photos as Featured Image when mouse moves on to it post
- WordPress Multisite: Images moved to /sites/1?
- ADD class to all my images (thumbail)
- Error 500 in loop to create posts and thumbnails
- How to view exact image dimensions of a media in Admin view?
- Why image Thumbnail url is not displaying with custom size?
- New portfolio items appearing smaller on the grid
- WordPress can’t detect any thumbnails size?
- Does WordPress have a way of changing the ‘Natural’ size of uploaded images?
- WooCommerce Variation Swatches and Photos – get attribute thumbnail
- Image thumbnail on single product issue | WooCommerce
- How Do I Auto Generate Thumbnail from First Embedded Image?
- Why doesn’t WordPress make thumbnails for videos?
- external url for post thumbnail and title
- How to delete post thumbnails in index page? (twenty fourteen theme)
- Create a custom attachment thumbnail for quick page load
- get the post thumbnail returns the full size
- Why are my ‘medium’ images the wrong size
- Display thumbnail of child, parent and ancestor using featured thumbnails
- Retrieve image from Open Graph of an external URL and set as featured image
- Thumbnail Look For WP
- Function to get thumbnail img source
- Imagem resolution responsive
- get_the_term_list & url
- Thumbnail remove width & height function
- Thumbnails from video posts not working after upgrading to WP 3.4
- PHP-Code inside Href-Tag
- Thumbnail informations (meta)
- How to include featured image on blog post preview?
- Thumbnails loading forever
- Delete all thumbnails & regenerate them?
- How to crop thumbnail size, from both width and height sides
- Media Library shows default image instead of image preview
- WordPress pointing animated GIF images with wrong file name upon upload (GIFs animation not working)