lundi 7 août 2017

images optimization in laravel application

I have a laravel web application with more than thousands of uploaded images in it. I have not optimized my images before and now I have to do the optimization.

now I have two questions about image optimization;

  1. I have problem with image optimization. I have tried any packages that would do the 'image optimization' but after running my optimization code, no changes would apply to the images in my source control. why the package does not change the images?
  2. I am using same images with different sizes in my application. forexample an image named "image_1.png" is using with the size 120*60 pxs in home page and also it is using in another page with size 300*150 pxs. what should I do for these images that are using with different sizes for optimization?

packages that I have used are these:

  1. http://ift.tt/2vFJVqI
  2. http://ift.tt/2uh9P0C

I am using the code like this for my images in database:

 foreach ($files as $file) {
            $filePath = //the image path
            ImageOptimizer::optimize($filePath);
        }

The above code successfully passes and no errors happen during the code running.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire