Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Webp picture format conversion method

A technology of picture format and conversion method, which is applied in the direction of using information identifiers to retrieve Web data, special data processing applications, website content management, etc. It can solve the problems that computers do not support Webp picture format, etc., and achieve enhanced functionality and easy use Effect

Active Publication Date: 2020-05-05
四川商通实业有限公司
View PDF10 Cites 5 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] However, there are still many computers that do not support the Webp image format, and it is necessary to provide a method that can convert Webp images into image formats supported by these computers.

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Examples

Experimental program
Comparison scheme
Effect test

Embodiment

[0036] A method for converting a Webp image format, comprising the following steps:

[0037] S1. Receive the image file in webp format uploaded by the user;

[0038] S2. Convert the image file in webp format into canvas, and obtain base64 data through canvas.toDataURL;

[0039] S3. Assign the base64 data to the src attribute of the img tag in the html page for display, and assign the base64 data to the href of the a tag in the html page (download option is provided);

[0040] S4. Obtain the image download instruction sent by the user, use the download attribute of the a tag, generate and send the target download image file to the user according to the obtained image download instruction (format conversion and download).

[0041] In one of the embodiments, step S2 includes the following steps:

[0042] S21. Determine whether the cutting instruction sent by the user has been received, if yes, go to step S22, if not, go to step S23;

[0043] S22. Initialize the cropping plug-i...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a Webp picture format conversion method. The method comprises the following steps: S1, receiving a picture file in a webp format uploaded by a user; S2, converting the picturefile in the webp format into canvas, and acquiring base 64 data through a canvas. ToData URL (Uniform Resource Locator); S3, assigning the base 64 data to the src attribute of the img label in the page to be displayed, and meanwhile, assigning the base 64 data to the href of the a label in the html page; and S4, obtaining a picture downloading instruction sent by the user, and generating and sending a target downloaded picture file to the user according to the obtained picture downloading instruction. By adopting HTML and JavaScript technology, the webp format picture file is uploaded, the picture format of the webp format picture file is converted on a webpage, and then general picture formats such as png and other format pictures are downloaded, so that a part of computers which cannotdirectly browse the webp format pictures can convert the webp format pictures into general formats and then browse the webp format pictures.

Description

technical field [0001] The invention relates to the technical field of image format conversion, in particular to a Webp image format conversion method. Background technique [0002] WebP format, an image format developed by Google to speed up image loading. The image compression size is only about 2 / 3 of JPEG, and it can save a lot of server broadband resources and data space. Well-known websites such as Facebook and Ebay have begun to test and use the WebP format. [0003] WebP supports both lossy and lossless compression. Encoding a WebP file of the same quality requires more computing resources than encoding a JPEG file. [0004] However, there are still many computers that do not support the Webp image format, and it is necessary to provide a method that can convert the Webp image into an image format supported by these computers. . Contents of the invention [0005] In order to solve the problems in the prior art, the invention provides a method for converting We...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F16/958G06F16/955H04L29/08
CPCG06F16/986G06F16/9566H04L67/06Y02D10/00
Inventor 张赛
Owner 四川商通实业有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products