When you use canvas to turn a PNG picture to JPEG, the transparent area is found to be filled with black.
The code is as follows:
Canvas:base64 the picture after transcoding:
Why would canvas PNG's transparent area turn black?
Canvas removes
BMP format
BMP is short for bitmap. It is a standard image file format in windows and can be supported by multiple Windows applications. With the popularity of the Windows operating system and the development of a wide range of Windows applications,
GIF, JPEG, and PNG are the three most common image formats.
GIF: It was born in 1987 and is often used in Webpage animation. It adopts lossless compression and supports 256 colors (generally 8 bit color). It supports a single transparent
Recently, I used metinfo 5.0 to build my own small site. The feature is quite good and useful. I found many small problems and I have done almost the same thing. I am too lazy to switch to other cms, fix it by yourself ~
Problem 1: The image
Note: If you want to use PHP GD processing we need to open the GD library
GD Library support for PHP under Windows
Find php.ini, open content, find:
; Extension=php_gd2.dll
Put the front semicolon ";" Remove, then save, if there is no semicolon,
P.S. Change the image upload class original address: http://blog.csdn.net/a957651480/article/details/23124257
Chk_err (-1); No incoming control name}else{$this->inputname = $inputName;} if (!empty ($allowType)) $this->allowtype = $allowType,
Part of the content is taken from the Internet. Select the best part and add it to your own practice. record it for future generations and convenience!
1. Generate JPG Images
Response. setcontenttype ("image/JPEG ");Int width = 32, Height =
Ma JianEmail:[email protected]Published: 2009.09.22Update:2012.06.11The relevant content has been updated for the new progress of Pdftoy.1 Introduction2 theory3 implementationConversion of 3.1 MRC model3.1.1 Single layer DjVu3.1.2 3 Floor DjVu3.1.3 2
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.