Operator Gambar

Operator Gambar Blogger
Daftar Isi Artikel []
Mengubah ukuran gambar dan membuat gambar responsive di blogger dengan operator gambar.

Syntax

OperatorSyntaxFungsi
resizeImageresizeImage(image, number, string)Merubah ukuran gambar
sourceSetsourceSet(image, array[number], string)Membuat gambar responsive
<!-- Resize Image -->
<img expr:src='resizeImage(data:view.featuredImage, 1280, "16:9"'/>

<img expr:src='resizeImage("https://3.bp.blogspot.com/-IzFYYZN_i1c/XO6uJfymd7I/AAAAAAAACz0/JuYWJVQpF1MV0w89RlYncl3aBiqZw-vkQCLcBGAs/s320/MasihPribadi.png", 1280, "16:9")'/>

<!-- sourceSet -->
<img expr:src='data:view.featuredImage'
     expr:srcset='sourceSet(data:view.featuredImage, [1280,720], "16:9")'/>

<img src='https://3.bp.blogspot.com/-IzFYYZN_i1c/XO6uJfymd7I/AAAAAAAACz0/JuYWJVQpF1MV0w89RlYncl3aBiqZw-vkQCLcBGAs/s320/MasihPribadi.png'
     expr:srcset='sourceSet("https://3.bp.blogspot.com/-IzFYYZN_i1c/XO6uJfymd7I/AAAAAAAACz0/JuYWJVQpF1MV0w89RlYncl3aBiqZw-vkQCLcBGAs/s320/MasihPribadi.png", [1280,720], "16:9"'/>

Hasil

<!-- Resize Image -->
<img src='https://3.bp.blogspot.com/-IzFYYZN_i1c/XO6uJfymd7I/AAAAAAAACz0/JuYWJVQpF1MV0w89RlYncl3aBiqZw-vkQCLcBGAs/w1280-h720-p-k-no-nu/MasihPribadi.png'/>

<!-- sourceSet -->
<img src='https://3.bp.blogspot.com/-IzFYYZN_i1c/XO6uJfymd7I/AAAAAAAACz0/JuYWJVQpF1MV0w89RlYncl3aBiqZw-vkQCLcBGAs/s320/MasihPribadi.png'
     srcset='https://3.bp.blogspot.com/-IzFYYZN_i1c/XO6uJfymd7I/AAAAAAAACz0/JuYWJVQpF1MV0w89RlYncl3aBiqZw-vkQCLcBGAs/w1280-h720-p-k-no-nu/MasihPribadi.png 1280w,
https://3.bp.blogspot.com/-IzFYYZN_i1c/XO6uJfymd7I/AAAAAAAACz0/JuYWJVQpF1MV0w89RlYncl3aBiqZw-vkQCLcBGAs/w720-h405-p-k-no-nu/MasihPribadi.png 720w'/>