Awesome! :)
I found and fixed the problem. It was in a function that controls output buffer ( ob_start() ) - in my php framework.
Hi. The second post doesn't show any workaround. The problem seems to be in php itself somewhere. Anyone else know how to fix this?
Piotr, Unfortunately I've stopped maintaining this library years ago, and will not be able to look into this. I'm happy you found a workaround, though! It's possible there's some PHP error being output which corrupts the images. You'd see this by viewing actual character data of the response. You could also analyze the HTTP headers and network response size to give you a clue for how do the two methods above differ. Cheers!
I change last 2 lines of the code to this: $tempFilePath = APPLICATION_PATH . DS . ApplicationPage::TEMP_DIR . DS . md5( $_SERVER["REMOTE_ADDR"] . $pictureName . microtime() ) . '.jpg'; $picture->saveToFile( $tempFilePath, 90 ); header( 'Content-Type: image/png' ); header( 'Content-Length: ' . filesize( $tempFilePath ) ); readfile( $tempFilePath ); and the file generated is correct and viewing it directly in browser also looks good, but loading it through PHP with the code above and outputing it...
I change last 2 lines of the code to this: $tempFilePath = APPLICATION_PATH . DS . ApplicationPage::TEMP_DIR . DS . md5( $_SERVER["REMOTE_ADDR"] . $pictureName . microtime() ) . '.jpg'; $picture->saveToFile( $tempFilePath, 90 ); header( 'Content-Type: image/png' ); header( 'Content-Length: ' . filesize( $tempFilePath ) ); readfile( $tempFilePath ); and the file generated is correct and viewing it directly in browser also looks good, but loading it through PHP with the code above and outputing it...
Hi! I really like this library, but it drives me mad when I get an image like the one I attached here. This is how it looks generated in browser using $image->output() function, but really I couldn't even save the image from browser to disk, I got "download failure" message, so I made a screenshot and saved as image. This happens only to some pictures, but seems to be an error in the library itself, not in the JPGs. When I add "quality" parameter to output() function (e.g. 80 or 90 or 100), then...
Hi! I really like this library, but it drives me mad when I get an image like the one I attached here. This is how it looks generated in browser using $image->output() function, but really I couldn't even save the image from browser to disk, I got "download failure" message, so I made a screenshot and saved as image. This happens randomly only to some pictures and seems to be an error in the library itself. When I add "quality" parameter to output() function (e.g. 80 or 90 or 100), then it looks...
I need help to adapt code.to resize my images to 500 * 375 I allready have code but...
I just want to create transparent png image from a jpg image like below: to I am...
WideImage PHP library is vulnerable to Reflected XSS Attack
Sanath, which version are you running? There is a bug with output() in the latest...
WideImage, Outputting to the browser directly doesn't work in my project. This is...
Allow "empty" arguments for resizing
Flavio, PNG doesn't have quality, only compression. Quote from WideImage doc: Note:...
Ops, I just found my error. saveToFile($imagens_dir."/".$fileout,90); I have to test...
I get the following error when dealing with a png file: Line -> 39 File -> C:\EasyPHP\www\projeto\config\wide_image\Mapper\PNG.php...
I have this, but I don´t understand how to fit my image onto the white background....
I have this, but I don´t understand how to fit my image onto the white background...
Yes. This demo page does something similar to what you want: http://wideimage.sourceforge.net/wp-content/current/demo/index.php?demo=resizeCanvas&output=preset%20for%20demo&colors=255&dither=1&match_palette=1...
Is there a possible way with PHP to create an image canvas with a white background,...