Follow Me:

Tuesday 21 July 2015

CwebP Unsupported Color Conversion Request:

    When i am creating WebP images, that time triggering the error as "cwebp unsupported color conversion request, Error Could not be process file".

 Error: 

    $imageName  = "ilikekaraikudi.jpg";
    $webpimgName  = "ilikekaraikudi.webp";
 
   cwebp -q 0 ".$imageName." -o ".$webpimgName.
   Unsupported color conversion request
   Error! Could not process file ilikekaraikudi.jpg
     
   Error! Cannot read input picture 

 

  Solution:

    we can try converting to RBG color-space via ImageMagick (convert) or any other image-editor tool.

    exec("convert -colorspace RGB ".$imageName." ".$webpimgName . " ");

Related Posts:

   1. how to create webp image in php
   2. fedex shipping integration
   3. 413 “Request Entity Too Large” error with uploading a file

   4. How to blink text in html for various browsers
   5. Difference between cookies and sessions in php

 

Thursday 16 July 2015

WebP:

    WebP is an image file type that was created in 2010 and is created by Google. This image format provides lossless and lossy compression to images on the server. Big social media websites are using WebP image process are Google, Facebook and EBay.
 
  WebP images natively supporting to the following browsers are Chrome, Opera, Opera Mini, Android Browser and Chrome for Android browsers only. It is not supported any other browsers like Firefox, IE and Safari,etc.

 


    WebP lossless image files are 26% smaller than PNGs.
    WebP lossy images files are 25-34% smaller than JPEG images at equivalent SSIM index.
    WebP supports lossless transparency (also known as alpha channel) with just 22% more bytes.

WebP images creating process in php:

you can use following php commands,to get the webp images

$imgName     =   "codingslovers.jpg";
$webPName   =   "codingslovers.webp";

Syntax:

 cwebp [quality qualitypercentage] [source image] -o [destination]

exec("cwebp -q 0 ".$imgName." -o ".$webPName." ");

Another Method:

exec("convert -colorspace RGB ".$imgName." ".$webPName . " ");

Exec : executes the given command in php

http://php.net/manual/en/function.exec.php

Advantages of WebP:

Smaller file size
Different compression algorithm
Smoother color gradations
Alpha channel mask

Disadvantages of WebP:

Weak browser support
Artifacting has plastic appearance
Poor exporting interface

Browserwise WebP Performance:


Monday 6 July 2015

Abstract class in PHP:


  •     Abstract Class  contains only declare the method's signature, they can't define the implementation.
    •     Abstraction class are defined using the keyword abstract .
    •     Abstract Class is not possible to implement multiple inheritance.
    •     Latest version of PHP 5 has introduces abstract classes and methods.
    •     Classes defined as abstract , we are unable to create the object ( may not instantiated ).


    •     we can extend the Abstract class, by using extends operator.
    •     we can inherit only one abstract class at one time extending.
    •     Any class that contains one abstract method must also be declare as abstract.
    •     All methods marked as abstract in the parent's class, declaration must be defined by the   child.
    •     Additionally, these methods must be defined with the same (or a less restricted) visibility           (Public,Protected & private).
    •     Type hint & number of parameter must be match between parent & child class.

      Related Posts: