Giter Site home page Giter Site logo

laravel-webp's People

Contributors

abdallhsamy avatar buglinjo avatar jelhan avatar laravel-shift avatar mahammad avatar terax6669 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

laravel-webp's Issues

Image conversion to WebP using cwebp failed with error code 1.

when I submit the form than show this error
Screenshot 2021-08-12 002103

its controller function
public function webp_image_store(Request $request){
$webp = Webp::make($request->file('images'));
if ($webp->save(public_path('webp_img))) {
// File is saved successfully
return back();
}
}
And its laravel-webp.php

'drivers' => [
    'cwebp' => [
        'path' => '/usr/local/bin/cwebp',
    ],
],

please tell me now which part change than I will get success result

Drivers[] is not supported

Hello,

I am trying to save the file in my folder but when I upload it it gives me an error Drivers[] not supported. I am running this script in Laravel Lumen API. I am running the system in Windows 10 locally.

Image conversion to WebP using cwebp failed with error code 127

Image conversion to WebP using cwebp failed with error code 127. This command was used to execute cwebp: /usr/local/bin/cwebp -q 60 /home/bogdan/test.jpg -o /opt/lampp/htdocs/adav/public/test.webp No output was sent to stdout

Laravel: 6.20.7
OS: Ubuntu 20.04

oo

Also error on tmp request file php
Снимок экрана_2020-12-14_20-41-15

Overrides to config file when runs composer update command

Hi. I noticed a minor bug in the Service Provider.

You had set a publish path grouped as laravel-assets in provider file. I think that part should be removed.

Steps To Reproduce:

  • Publish the config file on fresh laravel project.
  • Change the path for cwebp driver in the config/laravel-webp.php file
  • Run composer update command
  • And you will see changed the config file

Image conversion to WebP using cwebp failed with error code 126

Hello,

When I try to save the webp file using command explicitly, it is working fine.

/home/Desktop/photography/libwebp-1.1.0-rc2-linux-x86-64/bin/cwebp -q 80 lijesh_shakya.jpg -o lijesh_shakya1.webp

Screenshot from 2020-05-02 12-42-11

Problem arose when I gave the same path for cwebp in config/laravel-webp.php file like:

'drivers' => [

        'cwebp' => [
            'path' => '/home/Desktop/photography/libwebp-1.1.0-rc2-linux-x86-64/bin/cwebp',
        ],

    ],

And for saving code like:

Route::post('test.store', function(Request $request){
    $webp = \Webp::make($request->file('name'));
    if ($webp->save(storage_path('app/output.webp'))) {
        dd("worked");
    }else{
        dd('not worked');
    }
})->name('test.store');

It throws me an error like:

Buglinjo\LaravelWebp\CwebpShellExecutionFailed
Image conversion to WebP using cwebp failed with error code 126. This command was used to execute cwebp: /home/Desktop/photography/libwebp-1.1.0-rc2-linux-x86-64/bin/cwebp -q 80 /tmp/php3LZ0HJ -o /var/www/html/photography/storage/app/output.webp No output was sent to stdout

How to show webp image in Safari?

Hi,
I've used this plugin to convert all images into webp. Project technology is laravel(php). Is there any way to show jpg image if browser don't support webp?

Problem with function make

$webp = Webp::make($request->file); if ($webp->save(public_path($this->directory. '/'. $filenameWithoutExtension. '.webp'))) { echo 'test'; die; }

and I try with

$webp = Webp::make($request->file('file')); if ($webp->save(public_path($this->directory. '/'. $filenameWithoutExtension. '.webp'))) { echo 'test'; die; }

and i have the same problem "array_keys(): Argument #1 ($array) must be of type array, null given"
with funcion Webp::make

Image conversion to WebP using cwebp failed with error code 1.

On windows and I get this error when running it.

Image conversion to WebP using cwebp failed with error code 1.
This command was used to execute cwebp:
C:\Program Files (x86)/libwebp-1.2.0-windows-x64/bin/cwebp -q 80 C:\wamp64\tmp\image 5585.jpg -o C:\ .... \boilerplate\storage\app/webp/image 5585.webp
No output was sent to stdout

It looks like it doesnt like the space in my file paths. If in Cwebp Class in the save function you change the line to the following add the quotes It allows for spaces.

$cmd = '"' . $this->cwebpPath . '" -q ' . $quality . ' "' . $this->image->getPathname() . '" -o "' . $outputPath . '"';

Any chance you can get this fixed up asap? or is there a work around for it?

I can do this in my config file but doesnt allow for spaces in file name so a fix for al would be good.

'drivers' => [
                    'php-gd' => [],
                    'cwebp' => [
                        'path' => '"C:\Program Files (x86)/libwebp-1.2.0-windows-x64/bin/cwebp.exe"',
                    ],
                ],

Config file not published

Hello, i just install this package through composer, after vendor:publish i didn't see config file laravel-webp.php on config/laravel-webp.php, its normal and i can create it manualy? or i have to reinstall it? i'm using laravel 5.7.

Thanks

Image conversion to WebP using cwebp failed with error code 1

Hello,

When I try to save the webp file using command explicitly, it is working fine.

Capture

Problem arise when I gave the same path for cwebp in config/laravel-webp.php file like:

'drivers' => [

    'cwebp' => [
        'path' => 'C:/Users/dannyl/Downloads/libwebp-1.1.0-windows-x64 (2)/libwebp-1.1.0-windows-x64/bin/cwebp',
    ],

],

And for saving code like:
$path = "F:/test/property_images/";
$webp = Webp::make($request->file('profile_pic'));

            if ($webp->save($path.'output.webp')) {
                // File is saved successfully
                echo "file saved sccuess";
            }

Unnecessary output

Running \Webp::make($file)->save($path); when using cwebp results in printing:

Saving file '/var/www/html/storage/app/temp/test1.webp'
File:      /tmp/phpdhNICn
Dimension: 50 x 50
Output:    64 bytes Y-U-V-All-PSNR 99.00 99.00 99.00   99.00 dB
           (0.20 bpp)
block count:  intra4:          0  (0.00%)
              intra16:        16  (100.00%)
              skipped:        15  (93.75%)
bytes used:  header:             16  (25.0%)
             mode-partition:     10  (15.6%)
 Residuals bytes  |segment 1|segment 2|segment 3|segment 4|  total
    macroblocks:  |       6%|       0%|       0%|      94%|      16
      quantizer:  |      12 |      12 |      11 |       8 |
   filter level:  |       4 |       3 |       2 |       0 |

Please add -quiet or consider using something that will capture the output (like Symfony's Process class).

Webp::make($file)->save($path) returns true but can't find an image on given path

The issue occurred while working on Laravel 5.8 with php version 7.2

I'm using cwebp as a default driver, /usr/local/bin/cwebp as a path for cwebp.
And trying to convert my jpeg image to webp image using following code
$webp = Webp::make($file)->save($path);
Here, $webp returns true but, I can't find moved image on the path $path

webp not uploaded own path

Hi, i want make owm output image name and upload own path. how can i use ?

$file = Input::file('image');
$webp = Webp::make(\request()->get('image'));
  if ($file) {
          $image_name = $slug . '-' . time() . '.' . $file->getClientOriginalExtension();
          $image_webp_name = $slug . '-' . time() . '.' . 'webp';
          $path = 'images/uploads/category/orginal';
          $path_webp = 'images/uploads/category/webp';
          $image_url = $path . '/' . $image_name;
          $image_webp_url = $path_webp . '/' . $image_webp_name;
          $file->move($path, $image_name);
          $img = Image::make($image_url);
          $img->resize(360, 360);
          $img->save($image_url);
          $webp->save(public_path($image_webp_url));
   }

i use that format, orginal image work but webp image not uploaded my own path
thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.