Last active
February 24, 2018 13:28
-
-
Save mimalef70/b8c8c30e957ae5c3951ea9fa7784c1b4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$image_uri = $node->field_image['und'][0]['uri']; // or any public://my_image | |
$style = '360x500'; | |
$derivative_uri = image_style_path($style, $image_uri); | |
$success = file_exists($derivative_uri) || image_style_create_derivative(image_style_load($style), $image_uri, $derivative_uri); | |
$image_url = file_create_url($derivative_uri); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment