Ekstensi: WebP: Perbedaan antara revisi

Dari Catatan Pak Samsul
Loncat ke navigasi Loncat ke pencarian
kTidak ada ringkasan suntingan
kTidak ada ringkasan suntingan
 
(3 revisi perantara oleh pengguna yang sama tidak ditampilkan)
Baris 3: Baris 3:
Ekstensi ini membutuhkan <code>imagick</code>dan <code>libwebp</code>diinstal di server.
Ekstensi ini membutuhkan <code>imagick</code>dan <code>libwebp</code>diinstal di server.


Ekstensi: WebP
Download dan install
 


https://github.com/octfx/mediawiki-extension-WebP
<blockquote>'''Aktiifkan ekstensi WebP'''
<blockquote>'''Aktiifkan ekstensi WebP'''


<code>wfLoadExtension (  'WebP'  );</code>
<code>wfLoadExtension (  'WebP'  );</code>


// Enables WebP creation after a new image was uploaded
''// Enables WebP creation after a new image was uploaded''


<code>$wgWebPEnableConvertOnUpload = true;</code>
<code>$wgWebPEnableConvertOnUpload = true;</code>


// Enables WebP creation after a thumbnail was created
''// Enables WebP creation after a thumbnail was created''


<code>$wgWebPEnableConvertOnTransform = true;</code>
<code>$wgWebPEnableConvertOnTransform = true;</code>


// Compression quality of the image: 0 - 100 where 100 means most compressed
/''/ Compression quality of the image: 0 - 100 where 100 means most compressed''


<code>$wgWebPCompressionQuality = 50;</code>
<code>$wgWebPCompressionQuality = 50;</code>


// the strength of the deblocking filter, between 0 (no filtering) and 100 (maximum filtering). A value of 0 turns off any filtering. Higher values increase the strength of the filtering process applied after decoding the image. The higher the value, the smoother the image appears. Typical values are usually in the range of 20 to 50.
''// the strength of the deblocking filter, between 0 (no filtering) and 100 (maximum filtering). A value of 0 turns off any filtering. Higher values increase the strength of the filtering process applied after decoding the image. The higher the value, the smoother the image appears. Typical values are usually in the range of 20 to 50.''


<code>$wgWebPFilterStrength = 50;</code>
<code>$wgWebPFilterStrength = 50;</code>


// when enabled, the algorithm spends additional time optimizing the filtering strength to reach a well-balanced quality.
''// when enabled, the algorithm spends additional time optimizing the filtering strength to reach a well-balanced quality.''


<code>$wgWebPAutoFilter = true;</code>
<code>$wgWebPAutoFilter = true;</code>


// Create images through the JobQueue
''// Create images through the JobQueue''


<code>$wgWebPConvertInJobQueue = true;</code>
<code>$wgWebPConvertInJobQueue = true;</code>


// Thumbnail Sizes to create through the maintenance script
''// Thumbnail Sizes to create through the maintenance script''


<code>$wgWebPThumbSizes = [</code>
<code>$wgWebPThumbSizes = [</code>
Baris 51: Baris 51:


====Eksekusi script dibawah ini jika sebelumnya telah melakukan upload gambar sebelum melakukan install WebP Extension.====
====Eksekusi script dibawah ini jika sebelumnya telah melakukan upload gambar sebelum melakukan install WebP Extension.====
<blockquote>php extensions/WebP/maintenance/convert_images.php
<blockquote><code>php extensions/WebP/maintenance/convert_images.php</code>
 
''To only convert non-thumbnails run''


#To only convert non-thumbnails run
<code>php extensions/WebP/maintenance/convert_images.php --no-thumbs</code>


php extensions/WebP/maintenance/convert_images.php --no-thumbs
''To create thumbnails of custom sizes run''


#To create thumbnails of custom sizes run
''This will create two thumbnails with size 1000px and 1250px''


#This will create two thumbnails with size 1000px and 1250px
<code>php extensions/WebP/maintenance/convert_images.php --thumb-sizes=1000,1250</code>


php extensions/WebP/maintenance/convert_images.php --thumb-sizes=1000,1250
''To only work on some images run''


#To only work on some images run
<code>php extensions/WebP/maintenance/convert_images.php --titles=ImageA.jpg,ImageB.png</code>


php extensions/WebP/maintenance/convert_images.php --titles=ImageA.jpg,ImageB.png
''To force the creation of already existing images run''


#To force the creation of already existing images run
<code>php extensions/WebP/maintenance/convert_images.php --overwrite</code>


php extensions/WebP/maintenance/convert_images.php --overwrite
''Only work on page titles matching a prefix''


#Only work on page titles matching a prefix
''Every page starting with prefix 'Example' will be selected''


#Every page starting with prefix 'Example' will be selected
<code>php extensions/WebP/maintenance/convert_images.php --title-prefix=Example</code>


php extensions/WebP/maintenance/convert_images.php --title-prefix=Example
Only work on page titles matching a file-type


#Only work on page titles matching a file-type
Every page starting with file-type 'png' will be selected


#Every page starting with file-type 'png' will be selected
Can be combined with 'title-prefix'


#Can be combined with 'title-prefix'
<code>php extensions/WebP/maintenance/convert_images.php --file-type=png</code></blockquote>


php extensions/WebP/maintenance/convert_images.php --file-type=png</blockquote>Katagori<span> </span>: Mediawiki
Catagory : Mediawiki

Revisi terkini sejak 13 Februari 2021 04.57

The WebP perpanjangan menciptakan .webpversi gambar yang sudah diupload dan menampilkan mereka, jika browser mendukung meminta WebP gambar.

Ekstensi ini membutuhkan imagickdan libwebpdiinstal di server.

Download dan install

https://github.com/octfx/mediawiki-extension-WebP

Aktiifkan ekstensi WebP

wfLoadExtension ( 'WebP' );

// Enables WebP creation after a new image was uploaded

$wgWebPEnableConvertOnUpload = true;

// Enables WebP creation after a thumbnail was created

$wgWebPEnableConvertOnTransform = true;

// Compression quality of the image: 0 - 100 where 100 means most compressed

$wgWebPCompressionQuality = 50;

// the strength of the deblocking filter, between 0 (no filtering) and 100 (maximum filtering). A value of 0 turns off any filtering. Higher values increase the strength of the filtering process applied after decoding the image. The higher the value, the smoother the image appears. Typical values are usually in the range of 20 to 50.

$wgWebPFilterStrength = 50;

// when enabled, the algorithm spends additional time optimizing the filtering strength to reach a well-balanced quality.

$wgWebPAutoFilter = true;

// Create images through the JobQueue

$wgWebPConvertInJobQueue = true;

// Thumbnail Sizes to create through the maintenance script

$wgWebPThumbSizes = [

   120,

   320,

   800,

   1200,

   1600

];

Eksekusi script dibawah ini jika sebelumnya telah melakukan upload gambar sebelum melakukan install WebP Extension.

php extensions/WebP/maintenance/convert_images.php

To only convert non-thumbnails run

php extensions/WebP/maintenance/convert_images.php --no-thumbs

To create thumbnails of custom sizes run

This will create two thumbnails with size 1000px and 1250px

php extensions/WebP/maintenance/convert_images.php --thumb-sizes=1000,1250

To only work on some images run

php extensions/WebP/maintenance/convert_images.php --titles=ImageA.jpg,ImageB.png

To force the creation of already existing images run

php extensions/WebP/maintenance/convert_images.php --overwrite

Only work on page titles matching a prefix

Every page starting with prefix 'Example' will be selected

php extensions/WebP/maintenance/convert_images.php --title-prefix=Example

Only work on page titles matching a file-type

Every page starting with file-type 'png' will be selected

Can be combined with 'title-prefix'

php extensions/WebP/maintenance/convert_images.php --file-type=png

Catagory : Mediawiki