php - imagepng, set quality without writing to file, how? -


i want export png memory:

imagepng ($img, ?, 9); 

i want compress, need set filename too. dont want it, how then?

you this:

<?php ob_start(); imagepng($img, null, 9, png_all_filters); $image_data = ob_get_contents(); ob_end_clean(); 

from manual:

filename: path save file to. if not set or null, raw image stream outputted directly.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -