In Drupal 8 Manage display for the image field, I can assign only one image style.
I have two image styles: thumbnail and medium.
when I upload an image through image uploader, I need to view my uploaded image in those two image styles.
Is there a way to show the image in those two sizes from the single image I have uploaded?
If I selected thumbnail in the manage display on the image field it will save the image as thumbnail, but not as medium size as well. I need to save the image in both the sizes, or I need to get both the styled images from the single image I upload. The following code can get the image for the given style in manage display.
$imageStyle = ImageStyle::load('medium'); $galleryImage = $imageStyle->buildUri($image->entity->getFileUri());