CN109525796A - A kind of Webp picture format conversion method - Google Patents
A kind of Webp picture format conversion method Download PDFInfo
- Publication number
- CN109525796A CN109525796A CN201811519435.1A CN201811519435A CN109525796A CN 109525796 A CN109525796 A CN 109525796A CN 201811519435 A CN201811519435 A CN 201811519435A CN 109525796 A CN109525796 A CN 109525796A
- Authority
- CN
- China
- Prior art keywords
- format
- picture
- webp
- converted
- picture file
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N7/00—Television systems
- H04N7/01—Conversion of standards, e.g. involving analogue television standards or digital television standards processed at pixel level
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The invention discloses a kind of Webp picture format conversion methods, include the following steps: a, FileReader interface is called to read the picture file that user uploads into memory;B, picture file is converted into canvas;C, call canvas.toDataURL () that picture file is converted to Webp format;D, the picture file for having been converted into Webp format is put to showing in img label, and put in a label for downloading;E, it acknowledges receipt of user and clicks the corresponding download instruction of a label, the picture file for being converted into Webp format is downloaded to user.The present invention adds JavaScript technology using HTML, it uploads webp format picture file and converts picture format on webpage, then general picture format is downloaded, such as png format picture browses after allowing the computer that partially cannot directly browse webp format picture that webp format picture is converted into general format.
Description
Technical field
The present invention relates to multimedia technology field, especially a kind of Webp picture format conversion method.
Background technique
WebP format, a kind of picture format for being intended to accelerate picture loading velocity of Google (***) exploitation.Picture pressure
Contracting volume only about JPEG 2/3, and a large amount of server broadband resource and data space can be saved.Facebook,Ebay
Test is had begun etc. well-known website and uses WebP format.
WebP had both supported lossy compression or had supported lossless compression.Coding jpeg file is compared, the WebP of same quality is encoded
File needs to occupy more computing resources.
But Webp picture format is not still supported there are many computer at present, it is desirable to provide a kind of Webp picture to be converted
The picture format supported at these computers.
Summary of the invention
To solve problems of the prior art, the present invention provides a kind of Webp picture format conversion methods.
The technical solution adopted by the present invention is that:
A kind of Webp picture format conversion method, includes the following steps:
A, FileReader interface is called to read the picture file that user uploads into memory;
B, picture file is converted into canvas;
C, call canvas.toDataURL () that picture file is converted to Webp format;
D, the picture file for having been converted into Webp format is put to showing in img label, and put to supplying down in a label
It carries;
E, it acknowledges receipt of user and clicks the corresponding download instruction of a label, be converted into the picture file downloading of Webp format
To user.
Preferably, which uses HTML and JavaScript, is connect by web browser calling
Mouth, function complete the Webp format conversion of picture file.
The beneficial effects of the present invention are: adding JavaScript technology using HTML, webp format picture file is uploaded in net
Picture format is converted on page, then downloads general picture format, such as png format picture, so that part cannot directly browse
The computer of webp format picture browses after webp format picture being converted into general format.
Specific embodiment
The following describes the present invention in detail with reference to examples.
Embodiment
A kind of Webp picture format conversion method, includes the following steps:
A, FileReader interface is called to read the picture file that user uploads into memory;
B, picture file is converted into canvas;
C, call canvas.toDataURL () that picture file is converted to Webp format;
D, the picture file for having been converted into Webp format is put to showing in img label, and put to supplying down in a label
It carries;
E, it acknowledges receipt of user and clicks the corresponding download instruction of a label, be converted into the picture file downloading of Webp format
To user.
Specifically, which uses HTML and JavaScript, is connect by web browser calling
Mouth, function complete the Webp format conversion of picture file.
A specific embodiment of the invention above described embodiment only expresses, the description thereof is more specific and detailed, but simultaneously
Limitations on the scope of the patent of the present invention therefore cannot be interpreted as.It should be pointed out that for those of ordinary skill in the art
For, without departing from the inventive concept of the premise, various modifications and improvements can be made, these belong to guarantor of the invention
Protect range.
Claims (2)
1. a kind of Webp picture format conversion method, which comprises the steps of:
A, FileReader interface is called to read the picture file that user uploads into memory;
B, picture file is converted into canvas;
C, call canvas.toDataURL () that picture file is converted to Webp format;
D, the picture file for having been converted into Webp format is put to showing in img label, and put in a label for downloading;
E, it acknowledges receipt of user and clicks the corresponding download instruction of a label, the picture file for being converted into Webp format is downloaded to use
Family.
2. Webp picture format conversion method according to claim 1, which is characterized in that the Webp picture format conversion side
Method uses HTML and JavaScript, is converted by the Webp format that web browser calling interface, function complete picture file.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811519435.1A CN109525796A (en) | 2018-12-12 | 2018-12-12 | A kind of Webp picture format conversion method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811519435.1A CN109525796A (en) | 2018-12-12 | 2018-12-12 | A kind of Webp picture format conversion method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109525796A true CN109525796A (en) | 2019-03-26 |
Family
ID=65796558
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811519435.1A Pending CN109525796A (en) | 2018-12-12 | 2018-12-12 | A kind of Webp picture format conversion method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109525796A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111104631A (en) * | 2019-11-30 | 2020-05-05 | 四川商通实业有限公司 | Webp picture format conversion method |
CN112800372A (en) * | 2021-02-03 | 2021-05-14 | 网易(杭州)网络有限公司 | Page loading method and device and electronic equipment |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103139292A (en) * | 2013-01-22 | 2013-06-05 | 深圳市深信服电子科技有限公司 | Method for processing pictures in hyper text transmission protocol (HTTP) proxy and proxy server and system |
WO2015019368A1 (en) * | 2013-08-05 | 2015-02-12 | PISANI Sabino | Device and method for format conversion of files for three-dimensional vision |
CN104598902A (en) * | 2015-01-29 | 2015-05-06 | 百度在线网络技术(北京)有限公司 | Method and device for identifying screenshot and browser |
WO2016193543A1 (en) * | 2015-06-03 | 2016-12-08 | Nokia Technologies Oy | A method, an apparatus, a computer program for video coding |
WO2017048300A1 (en) * | 2015-09-18 | 2017-03-23 | Rifl Media Llc | Social network for curating and contextual discussion of hosted multi-media content |
CN106709960A (en) * | 2015-11-17 | 2017-05-24 | 北京国双科技有限公司 | Image storage method, device and system |
CN107680144A (en) * | 2017-10-16 | 2018-02-09 | 郑州云海信息技术有限公司 | A kind of method and device of WebP files conversion |
CN107911456A (en) * | 2017-11-17 | 2018-04-13 | 深圳泉眼体育运营管理有限公司 | Flow optimization method, device, terminal device and the storage medium of picture loading |
CN108600373A (en) * | 2018-04-26 | 2018-09-28 | 广州沐思信息科技有限公司 | A kind of Picture Generation Method, server and computer readable storage medium |
-
2018
- 2018-12-12 CN CN201811519435.1A patent/CN109525796A/en active Pending
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103139292A (en) * | 2013-01-22 | 2013-06-05 | 深圳市深信服电子科技有限公司 | Method for processing pictures in hyper text transmission protocol (HTTP) proxy and proxy server and system |
WO2015019368A1 (en) * | 2013-08-05 | 2015-02-12 | PISANI Sabino | Device and method for format conversion of files for three-dimensional vision |
CN104598902A (en) * | 2015-01-29 | 2015-05-06 | 百度在线网络技术(北京)有限公司 | Method and device for identifying screenshot and browser |
WO2016193543A1 (en) * | 2015-06-03 | 2016-12-08 | Nokia Technologies Oy | A method, an apparatus, a computer program for video coding |
WO2017048300A1 (en) * | 2015-09-18 | 2017-03-23 | Rifl Media Llc | Social network for curating and contextual discussion of hosted multi-media content |
CN106709960A (en) * | 2015-11-17 | 2017-05-24 | 北京国双科技有限公司 | Image storage method, device and system |
CN107680144A (en) * | 2017-10-16 | 2018-02-09 | 郑州云海信息技术有限公司 | A kind of method and device of WebP files conversion |
CN107911456A (en) * | 2017-11-17 | 2018-04-13 | 深圳泉眼体育运营管理有限公司 | Flow optimization method, device, terminal device and the storage medium of picture loading |
CN108600373A (en) * | 2018-04-26 | 2018-09-28 | 广州沐思信息科技有限公司 | A kind of Picture Generation Method, server and computer readable storage medium |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111104631A (en) * | 2019-11-30 | 2020-05-05 | 四川商通实业有限公司 | Webp picture format conversion method |
CN112800372A (en) * | 2021-02-03 | 2021-05-14 | 网易(杭州)网络有限公司 | Page loading method and device and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111104631B (en) | Webp picture format conversion method | |
CN103177015B (en) | Web page image methods of exhibiting and system | |
CN108984174A (en) | Cross-platform application creation method, device, server and storage medium | |
US20100050089A1 (en) | Web browser system of mobile communication terminal, using proxy server | |
CN108337528A (en) | A kind of method and apparatus of preview video | |
WO2019177792A1 (en) | Machine learning system for reduced network bandwidth transmission of content | |
CN111580879A (en) | Applet running method and device, electronic equipment and computer storage medium | |
CN105589836A (en) | Document previewing method, terminal and server | |
US20170083487A1 (en) | Webpage data processing method and device | |
CN108416021B (en) | Browser webpage content processing method and device, electronic equipment and readable medium | |
US10284686B2 (en) | Server, client, system and method for preloading browsed page in browser | |
CN102184231A (en) | Method and device for acquiring page resources | |
CN109785939A (en) | Medical image display methods, device, equipment and storage medium based on cloud | |
CN109525796A (en) | A kind of Webp picture format conversion method | |
CN104050212A (en) | Method and system for mobilizing a web application to take advantage of a native device capability | |
CN102209140A (en) | Method of playing flash file of mobile communication equipment terminal through browser and apparatus thereof | |
CN104378428A (en) | Method and device for downloading files | |
CN106210135A (en) | Picture resource download process method, terminal and Resource Server | |
CN105205151A (en) | Method and system for saving browser page flow at mobile terminal | |
CN113163198A (en) | Image compression method, decompression method, device, equipment and storage medium | |
CN105592081A (en) | Method for converting videos between terminal and server | |
CN103780649B (en) | The method, system and device of user's page-turning speed are improved under transfer mode | |
CN112379933B (en) | Application program starting method, device, medium and electronic equipment | |
CN105630319A (en) | Two-dimensional code generation method and apparatus as well as secure decoding method and apparatus for two-dimensional code | |
CN102377793A (en) | Flash interaction method and device based on mobile communication equipment terminal |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190326 |