Images are stored in a different server than the one i use. Is there a way to losslessly compress them using php and after compression show the images to my site without having to download the images to my server and store them? I do not have any access to the server that the images are stored. I can only download them to my server. Right now i just use the url of the picture to load the images to my site but GTmetrix is constantly mentioning about losslessly compress the images. Any thoughts?
Optimize images - Losslessly compress images in php
366 Views Asked by stefanosn At
1
There are 1 best solutions below
Related Questions in PHP
- php Variable name must change in for loop
- register_shutdown_function is not getting called
- Query returning zero rows despite entries existing
- Retrieving *number* pages by page id
- Automatically closing tags in form input?
- How to resize images with PHP PARSE SDK
- how to send email from localhost using codeigniter?
- Mariadb max Error while sending QUERY packet PID
- Multiusers login redirect different page in php
- Imaginary folder when I use "DirectoryIterator" in PHP?
- CodeIgniter + XDebug: debug only working in the main controller, index() function
- PHP script timeout when I use sleep()
- posting javascript populated form to another php page
- AJAX PHP - Reload div after submit
- PHP : How can I check Array in array?
Related Questions in LOSSLESS-COMPRESSION
- Will Serialization Help in Storing a Huffman Tree To A File
- Is there a utility for estimating a file's size after compression?
- Can anyone make heads or tales of this spigot algorithm code Pitiny.c
- Decode lossless predictive coding
- What is the best lossless compression algorithm for random data
- record 120 sec video and want to reduce size up to 3-4 MB in Android
- Save space writing bitset to a file in C++
- How to achieve minimum size when compressing small amount of data lossless?
- Which deflate (zip) algorithm characteristics can cause a 50% compression factor on the recompression of certain data?
- Optimize images - Losslessly compress images in php
- Compression algorithms for nearly uniform data
- dealing with ljpeg (lossless jpeg) using matlab
- LZ4 match search algorithm (fast scan)
- How do I set up CloudLab for a Simple Experiment?
- Library for further (lossless) Jpeg-compression
Related Questions in GTMETRIX
- Optimize images - Losslessly compress images in php
- Bad performance of Angular site in gtmetrix
- GTMetrix ignores Jetpack CDN
- Why do I have to test my site twice on GTmetrix to see the speed benefits of cloudflare?
- Geting a ? Performance score in page insights
- Static assets not being served through Cloudflare CDN
- How to remove Cloudflare’s javascripts slowing my site?
- Gt Metrix time between requests
- Page Speed Insights and Measure Versus GT Metrix different results
- How to send a post request to GTMetrix
- What is fully loaded time on GTmetrix and why is it important?
- Why page speed score are not increasing in WordPress?
- minify , defer and speed up the slider revolution js css files in wordpress
- Firebase hosting
- GTmetrix about speed issue
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
You can use something like the kraken-php image API to achieve your goal, granted you have access to the files of the server. If you have composer installed and running, you may use that too, but again, you need access to the server somehow. If you decide to access the files you can install using their install page. You have the option to return the request immediately in a file or you can post it to a URL that can be accessed by the server. Your request may look something like:
and your response may look something like:
Your PHP code for setting up the response may look something like:
You can handle the response like you would a normal JSON request, and you can query the image URL for the processed image. However, you will need to sign up for their API, which is not free. If you are looking for a free solution, with fewer features, you can check out pngquant. This is coincidently how services like Kraken work, but it will take longer to have a robust system setup. You will, again, need some form of access to the server. Otherwise, you can't really do anything about it.