Images crop
Categories
Component ID
Component name
Component type
Maintenance status
Development status
Component security advisory coverage
Component created
Component changed
Component body
At the install, the module will generate many new images styles
Don't forget to add the new field "image_crop" to at least one content type
Example :
Default :
- Thumbnail (100x100)
- Medium (220x220)
- Large (480x480)
Generated image style :
- large_center_bottom
- large_center_center
- large_center_top
- large_left_center
- large_right_center
- medium_center_bottom
- medium_center_center
- medium_center_top
- medium_left_center
- medium_right_center
- thumbnail_center_bottom
- thumbnail_center_center
- thumbnail_center_top
- thumbnail_left_center
- thumbnail_right_center
The configuration page allow you to change the cropping ratio /admin/config/media/image-crop
Explanation :
If ratio = 1.5 Thumbnail size = 100x100 BEFORE CROPPING : thumbnail_center_top size = 150x150 AFTER CROPPING : thumbnail_center_top size = 100x100
_center_top mean that 50 pixel are removed from the right and bottom
_center_bottom mean that 50 pixel are removed from the right and top
Regenerate image style after add a new one :
/admin/config/media/image-crop
Click "Save configuration", previous generated style will be removed and recreated
Dev
Now instead of calling :
image_style_url([ STYLE NAME ], [ URI ]);
Use :
get_image_cropped($node, [ STYLE NAME ]);
