CN103399864A - Image conversion method and device - Google Patents

Image conversion method and device Download PDF

Info

Publication number
CN103399864A
CN103399864A CN2013102808653A CN201310280865A CN103399864A CN 103399864 A CN103399864 A CN 103399864A CN 2013102808653 A CN2013102808653 A CN 2013102808653A CN 201310280865 A CN201310280865 A CN 201310280865A CN 103399864 A CN103399864 A CN 103399864A
Authority
CN
China
Prior art keywords
picture
png
png form
format
format information
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.)
Granted
Application number
CN2013102808653A
Other languages
Chinese (zh)
Other versions
CN103399864B (en
Inventor
王亚辉
朱才
许瑞军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Xiaomi Technology Co Ltd
Original Assignee
Beijing Xiaomi Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Xiaomi Technology Co Ltd filed Critical Beijing Xiaomi Technology Co Ltd
Priority to CN201310280865.3A priority Critical patent/CN103399864B/en
Publication of CN103399864A publication Critical patent/CN103399864A/en
Application granted granted Critical
Publication of CN103399864B publication Critical patent/CN103399864B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to an image conversion method and device. The method includes the following steps: obtaining format information of an image, judging whether the image is in a 9.png format according to the format information, and converting the image into the 9.png format if the image is not in the 9.png format. According to the image conversion method and device, automatic judgment can be performed, the image which is not in the 9.png format can be converted into the 9.png format, and the situation that a program is inoperative in loading or the program is abnormal is avoided.

Description

A kind of image converting method and device
Technical field
The invention relates to technical field of image processing, especially about the image format conversion technical field, is about a kind of image converting method and device specifically.
Background technology
PNG English name be Portable Network Graphics, i.e. portable network picture.Be a kind of non-distortion compress bitmap graphics file format, be widely used in now on internet and other aspects.The PNG form is the compression of non-distortion, allows to use the palette technology that is similar to the GIF form, supports true color image, and possesses the characteristic such as alpha channel (translucent).
9.PNG be a kind of special picture format of Android (android) platform, the picture of this form has the ability of self-adaptation adjusting size under the android environment.Allow the developer to define expandable area, when needs extend picture with the larger zone of packing ratio picture itself, but the content of expansion area is extended.And allow the developer to define the content viewing area, for display text or other guide.
In actual applications, when application program need to load the picture of a 9.PNG form, if the user replaces with common PNG or the picture of extended formatting by this pictures, will make to load do not come into force or generating program abnormal.Such as in realizing changing the program of skin function, if program needs the picture of a 9.PNG form and can't obtain, just may cause changing skin unsuccessful.
Summary of the invention
For overcoming the problem that exists in correlation technique, the embodiment of the present invention provides a kind of image converting method and device.
The embodiment of the present invention provides a kind of image converting method, and described method comprises: the format information that obtains picture; According to described format information, judge whether described picture is the 9.png form; If described picture is not the 9.png form, described picture is converted to the 9.png form.
Preferably, before obtaining the format information of picture, described method also comprises: receive the picture load request; Whether the picture that judges required loading according to described load request is the 9.png form; If the picture that needs to load is the 9.png form, continue to obtain the format information of picture.
Preferably, the described format information that obtains picture is: the format information that obtains the Target Photo corresponding with the picture load request.
Preferably, describedly according to described format information, judge whether described picture is that the 9.png form comprises: according to described format information, judge whether described picture is the png form; If described picture is the png form, continue to judge whether described picture is the 9.png form; If described picture is not the png form, judge that described picture is not the 9.png form.
Preferably, describedly described picture is converted to the 9.png form comprises: if described picture is the png form, by described picture, from the png format conversion, be the 9.png form; If described picture is not the png form, first described picture is converted to the png form, then from the png format conversion, is the 9.png form by described picture.
Preferably, described is that the 9.png form comprises by described picture from the png format conversion: according to data block that comprises 9.png information of picture structure of png form; The data block that will comprise 9.png information is inserted in the data stream of picture of png form, obtains the picture of 9.png form.
The embodiment of the present invention also provides a kind of picture conversion equipment, and described device comprises: the format information acquiring unit, be used to obtaining the format information of picture; Whether the picture format judging unit is the 9.png form for according to described format information, judging described picture; The picture format converting unit, for when described picture is not the 9.png form, be converted to the 9.png form by described picture.
Preferably, described device also comprises: the load request receiving element, be used to receiving the picture load request; Whether the load request judging unit is the 9.png form for the picture that judges required loading according to described load request; When described format information acquiring unit is the 9.png form for the picture that loads at needs, continue to obtain the format information of picture.
Preferably, described format information acquiring unit is for obtaining the format information of Target Photo corresponding to picture load request.
Preferably, described picture format judging unit comprises: whether the first judge module is the png form for according to described format information, judging described picture; The second judge module, for when described picture is the png form, judge whether described picture is the 9.png form.
Preferably, described picture format converting unit comprises: the first modular converter, for when described picture is the png form, is the 9.png form by described picture from the png format conversion; The second modular converter, while for described picture, not being the png form, be converted to the png form by described picture.
Preferably, described the first modular converter is also for data block that comprises 9.png information of the structure of the picture according to the png form; And the data block that will comprise 9.png information is inserted in the data stream of picture of png form, obtains the picture of 9.png form.
A kind of image converting method and device that the embodiment of the present invention provides, can automatic decision and the picture of non-9.PNG form is converted to the 9.PNG form, avoids program to occur loading not coming into force or situation that generating program is abnormal.
The accompanying drawing explanation
Accompanying drawing described herein is used to provide a further understanding of the present invention, forms the application's a part, does not form limitation of the invention.In the accompanying drawings:
Fig. 1 is a kind of image converting method process flow diagram that the embodiment of the present invention provides;
Fig. 2 is the process flow diagram of step S102 in Fig. 1 of providing of the embodiment of the present invention;
Fig. 3 is the process flow diagram of step S103 in Fig. 1 of providing of the embodiment of the present invention;
Fig. 4 is the process flow diagram of step S302 in Fig. 3 of providing of the embodiment of the present invention;
Fig. 5 is the process flow diagram of step S303 in Fig. 3 of providing of the embodiment of the present invention;
Fig. 6 is a kind of image converting method process flow diagram that the embodiment of the present invention provides;
Fig. 7 is a kind of picture conversion equipment block diagram that the embodiment of the present invention provides;
Fig. 8 is a kind of picture conversion equipment block diagram that the embodiment of the present invention provides.
Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, below in conjunction with embodiment and accompanying drawing, the present invention is described in further details.At this, exemplary embodiment of the present invention and explanation thereof be for explaining the present invention, but not as a limitation of the invention.
The embodiment of the present invention provides a kind of image converting method and device, and the present invention is described in detail below in conjunction with accompanying drawing.
Embodiment mono-
Fig. 1 is a kind of image converting method process flow diagram that the embodiment of the present invention provides, and as shown in Figure 1, described method comprises:
S101, obtain the format information of picture.
In embodiments of the present invention, when the application program in terminal need to load the picture of 9.png form, at first terminal will obtain the format information of the picture that will be loaded, so that the form of the picture that next step judgement will be loaded.
S102, judge according to described format information whether described picture is the 9.png form.
In embodiments of the present invention, whether terminal is the 9.png form according to the picture that the format information judgement that gets will be loaded, and format information can comprise suffix name, picture file length and the picture file the 38th, 39 of picture file, the information such as value of 40,41 bytes.
S103, if described picture is not the 9.png form, be converted to the 9.png form by described picture.
In embodiments of the present invention, if described picture is the 9.png form, application program can directly load the picture of 9.png form.If described picture is not the 9.png form, terminal need to first be converted to the 9.png form by picture, reloads afterwards the picture of 9.png form.
A kind of image converting method that the embodiment of the present invention provides, can automatic decision and the picture of non-9.PNG form is converted to the 9.PNG form, avoids program to occur loading not coming into force or situation that generating program is abnormal.
Fig. 2 is the process flow diagram of step S102 in Fig. 1 of providing of the embodiment of the present invention, and as shown in Figure 2, step S102 comprises:
S201, judge according to described format information whether described picture is the png form.
In embodiments of the present invention, at first terminal judges according to the format information of the picture that gets whether picture is the png form, preferably, format information can comprise suffix name, picture file length and the picture file the 38th, 39 of picture file, 40, at first the information such as value of 41 bytes, terminal can judge according to the suffix name of picture whether picture is the png form, if described picture is the png form, carry out step S203, continue to judge whether the png picture is the 9.png form; If described picture is not the png form, carry out step S202.
S202, if described picture is not the png form, judge that described picture is not the 9.png form.
S203, if described picture is the png form, whether the file size that continues to judge the png picture, greater than 40 bytes, is not the 9.png form if the file size of png picture less than or equal to 40 bytes, judges described picture; If the file size of png picture, greater than 40 bytes, carries out step S204.
S204, the 38th, 39,40 of judgement png picture, whether the value of 41 bytes is " npTc " four ASCII character values corresponding to letter, if the png picture the 38th, 39, the value of 40,41 bytes is " npTc " four ASCII character values corresponding to letter, judges that described picture is the 9.png form; If the 38th of png picture, the value of 39,40,41 bytes are not " npTc " four ASCII character values corresponding to letter, judge that described picture is not the 9.png form.
Fig. 3 is the process flow diagram of step S103 in Fig. 1 of providing of the embodiment of the present invention, and as shown in Figure 2, step S103 comprises:
S301, if described picture is not the png form, be converted to the png form by described picture, performs step afterwards S302 again, by described picture, from the png format conversion, is the 9.png form.
In embodiments of the present invention, judged result according to step S202, if described picture is not the png form, jpeg format or other picture formats in this way, can first picture be converted to the png form from jpeg format or other picture formats, perform step afterwards S302, every like this picture that can be converted to the png form just can be converted to the 9.png form again.
S302, if described picture is the png form, according to data block that comprises 9.png information of picture structure.
Fig. 4 is the process flow diagram of step S302 in Fig. 3 of providing of the embodiment of the present invention, and as shown in Figure 4, in embodiments of the present invention, step S302 can comprise following sub-step:
S3021, resolve and obtain original PNG picture width and the height, be designated as respectively width, height;
S3022, the empty array of 52 byte lengths of structure, be designated as chunk[];
S3023, be filled to respectively 1,2,2,1 equivalences by front four bytes of chunk array;
S3024, be filled into the width width of original PNG picture 37~40 bytes of chunk array according to " holding greatly order " pattern;
S3025, be filled into the height height of original PNG picture 45~48 bytes of chunk array according to " holding greatly order " pattern;
S3026, be filled into numerical value 0 or 1 49th~52 bytes of chunk array according to " holding greatly order " pattern, obtain comprising the data block of 9.png information.
S303, the data block that will comprise 9.png information is inserted in the data stream of picture of png form, obtains the picture of 9.png form.
Fig. 5 is the process flow diagram of step S303 in Fig. 3 of providing of the embodiment of the present invention, and as shown in Figure 5, in embodiments of the present invention, step S303 can comprise following sub-step:
S3031, read front 41 bytes of original PNG picture, is designated as srcHeader[];
S3032, construct an empty array that length is 105 byte lengths, is designated as destHeader[];
S3033, copy front 33 bytes of srcHeader in front 33 bytes of destHeader;
S3034, be filled into numerical value 52 in 34th~37 bytes of destHeader array according to " holding greatly order " pattern;
S3035, the ASCII character value that " npTc " is corresponding is filled into respectively in 38~41 bytes of destHeader data;
S3036, copy 42~93 byte places of chunk content to destHeader;
S3037, copy 98~105 byte places of 34~41 bytes of srcHeader to destHeader;
S3038, with srcHeader data in the original PNG picture of replacement of destHeader data, obtain the picture of 9.png form.
Embodiment bis-
Fig. 6 is a kind of image converting method process flow diagram that the embodiment of the present invention provides, and as shown in Figure 6, described method comprises:
S601, receive the picture load request.
In embodiments of the present invention, when the application program of moving in terminal need to Load Image, can send a picture load request to terminal, terminal receives the picture load request of application program.
S602, whether the picture that needs to load according to described load request judgement is the 9.png form.
In embodiments of the present invention, in the picture load request, can comprise the Format Type of the picture of the required loading of application program, terminal judges according to the picture load request whether application program will load the picture of 9.png form.
S603, if the picture that needs to load is the 9.png form, continue to obtain the format information of picture.
In embodiments of the present invention, if the picture that application program need to load is not the 9.png form, terminal directly Loads Image; If the picture that application program need to load is the 9.png form, terminal finds corresponding Target Photo according to the picture load request, and obtains the format information of Target Photo.
S604, judge according to described format information whether described picture is the 9.png form.
In embodiments of the present invention, whether terminal is the 9.png form according to Target Photo corresponding to format information judgement that gets.
S605, if described picture is not the 9.png form, be converted to the 9.png form by described picture.
In embodiments of the present invention, if Target Photo is the 9.png form, application program can directly load the picture of 9.png form.If Target Photo is not the 9.png form, terminal need to first be converted to the 9.png form by picture, reload afterwards the picture of 9.png form.
A kind of image converting method that the embodiment of the present invention provides, can automatic decision and the picture of non-9.PNG form is converted to the 9.PNG form, avoids program to occur loading not coming into force or situation that generating program is abnormal.And the conversion to picture format is real-time, and namely this conversion behavior occurs over just in the process that this resource is being loaded, and does not therefore need to do the pre-service of any off-line.
Embodiment tri-
Fig. 7 is a kind of picture conversion equipment block diagram that the embodiment of the present invention provides, and as shown in Figure 7, described picture conversion equipment comprises:
Format information acquiring unit 701, be used to obtaining the format information of picture.
In embodiments of the present invention, when the application program in terminal need to load the picture of 9.png form, at first format information acquiring unit 701 will obtain the format information of the picture that is loaded, so that the form of the picture that 702 next step judgements of picture format judging unit are loaded, format information can comprise suffix name, picture file length and the picture file the 38th of picture file, the information such as value of 39,40,41 bytes.
Whether picture format judging unit 702 is the 9.png form for according to described format information, judging described picture.
In embodiments of the present invention, whether the picture that is loaded of the format information judgement that gets according to format information acquiring unit 701 of picture format judging unit 702 is the 9.png form.
Picture format converting unit 703, for when described picture is not the 9.png form, be converted to the 9.png form by described picture.
In embodiments of the present invention, if the described picture of picture format judging unit 702 judgement is the 9.png form, application program can directly load the picture of 9.png form.If the described picture of picture format judging unit 702 judgement is not the 9.png form, picture format converting unit 703 need to first be converted to the 9.png form by picture, by application program, is loaded afterwards the picture of 9.png form again.
A kind of picture conversion equipment that the embodiment of the present invention provides, can automatic decision and the picture of non-9.PNG form is converted to the 9.PNG form, avoids program to occur loading not coming into force or situation that generating program is abnormal.
As shown in Figure 7, picture format judging unit 702 can comprise:
Whether the first judge module 7021 is the png form for according to described format information, judging described picture.
In embodiments of the present invention, the first judge module 7021 judges according to the format information of the picture that format information acquiring unit 701 gets whether picture is the png form, preferably, the first judge module 7021 can judge according to the suffix name of picture whether picture is the png form, if the described picture of the first judge module 7021 judgement is the png form, by the second judge module 7022, continued to judge whether described picture is the 9.png form; If the described picture of the first judge module 7021 judgement is not the png form, picture format judging unit 702 judges that directly described picture is not the 9.png form.
The second judge module 7022, for when described picture is the png form, judge whether described picture is the 9.png form.
In embodiments of the present invention, if the described picture of the first judge module 7021 judgement is the png form, the second judge module 7022 continues to judge that whether the file size of png picture is greater than 40 bytes, if it is not the 9.png form that the file size of png picture less than or equal to 40 bytes, judges described picture; If the file size of png picture is greater than 40 bytes, the second judge module 7022 continues the 38th of judgement png picture, 39, whether the value of 40,41 bytes is " npTc " four ASCII character values corresponding to letter, if the png picture the 38th, 39, the value of 40,41 bytes is " npTc " four ASCII character values corresponding to letter, judges that described picture is the 9.png form; If the 38th of png picture, the value of 39,40,41 bytes are not " npTc " four ASCII character values corresponding to letter, judge that described picture is not the 9.png form.
As shown in Figure 7, picture format converting unit 703 can comprise:
The first modular converter 7031, for when described picture is not the png form, be converted to the png form by described picture, by the second modular converter 7032, by described picture, from the png format conversion, is the 9.png form more afterwards.
In embodiments of the present invention, if described picture is not the png form, jpeg format or other picture formats in this way, the first modular converter 7031 can first be converted to the png form by form from JPEG or other picture formats, by the second modular converter 7032, by described picture, from the png format conversion, be the 9.png form more afterwards, every like this picture that can be converted to the png form just can be converted to the 9.png form.
The second modular converter 7032, for when described picture is not the png form, be converted to the png form by described picture.Preferably, if described picture is the png form, the second modular converter 7032 can be constructed a data block that comprises 9.png information according to picture; And the data block that will comprise 9.png information is inserted in the data stream of picture of png form, obtains the picture of 9.png form.
In embodiments of the present invention, width and the height of original PNG picture resolved and obtained to the second modular converter 7032 at first, is designated as respectively width, height; Construct afterwards the empty array of 52 byte lengths, be designated as chunk[]; Front four bytes of chunk array are filled to respectively to 1,2,2,1 equivalences; Again the width width of original PNG picture is filled into to 37~40 bytes of chunk array according to " holding greatly order " pattern; Simultaneously the height height of original PNG picture is filled into to 45~48 bytes of chunk array according to " holding greatly order " pattern; Finally numerical value 0 or 1 is filled into to 49th~52 bytes of chunk array according to " holding greatly order " pattern, obtains comprising the data block of 9.png information.
In embodiments of the present invention, after the second modular converter 7032 constructed according to picture the data block that comprises 9.png information, at first the second modular converter 7032 read front 41 bytes of original PNG picture, is designated as srcHeader[]; And construct the empty array that a length is 105 byte lengths, be designated as destHeader[]; Copy afterwards front 33 bytes of srcHeader in front 33 bytes of destHeader; Numerical value 52 is filled in 34th~37 bytes of destHeader array according to " holding greatly order " pattern; The ASCII character value that " npTc " is corresponding is filled into respectively in 38~41 bytes of destHeader data; Copy 42~93 byte places of chunk content to destHeader; Copy 98~105 byte places of 34~41 bytes of srcHeader to destHeader; Finally use srcHeader data in the original PNG picture of replacement of destHeader data, obtain the picture of 9.png form.
Embodiment tetra-
Fig. 8 is a kind of picture conversion equipment block diagram that the embodiment of the present invention provides, and as shown in Figure 8, described picture conversion equipment comprises:
Load request receiving element 801, be used to receiving the picture load request.
In embodiments of the present invention, when the application program of moving in terminal need to Load Image, can send a picture load request to terminal, load request receiving element 801 receives the picture load request of application program.
Whether load request judging unit 802 is the 9.png form for the picture that needs to load according to described load request judgement.
In embodiments of the present invention, in the picture load request, can comprise the Format Type of the picture of the required loading of application program, load request judging unit 802 judges according to the picture load request whether application program will load the picture of 9.png form.
Format information acquiring unit 803, while for the picture that loads at needs, being the 9.png form, continue to obtain the format information of picture.
In embodiments of the present invention, if the picture that application program need to load is not the 9.png form, application program directly Loads Image; If the picture that application program need to load is the 9.png form, format information acquiring unit 803 finds corresponding Target Photo according to the picture load request, and obtains the format information of Target Photo.
Whether picture format judging unit 804 is the 9.png form for according to described format information, judging described picture.
In embodiments of the present invention, whether picture format judging unit 804 is the 9.png form according to Target Photo corresponding to format information judgement that gets.
Picture format converting unit 805, for when described picture is not the 9.png form, be converted to the 9.png form by described picture.
In embodiments of the present invention, if Target Photo is the 9.png form, application program can directly load the picture of 9.png form.If Target Photo is not the 9.png form, picture format converting unit 805 need to first be converted to the 9.png form by picture, application program reloads the picture of 9.png form afterwards.
A kind of picture conversion equipment that the embodiment of the present invention provides, can automatic decision and the picture of non-9.PNG form is converted to the 9.PNG form, avoids program to occur loading not coming into force or situation that generating program is abnormal.And the conversion to picture format is real-time, and namely this conversion behavior occurs over just in the process that this resource is being loaded, and does not therefore need to do the pre-service of any off-line.
In addition, typically, terminal of the present invention can be various terminal devices, such as mobile phone, personal digital assistant (PDA) etc., so protection scope of the present invention should not be defined as the terminal of certain particular type.
In addition, the method according to this invention can also be implemented as the computer program of being carried out by CPU.When this computer program is carried out by CPU, carry out the above-mentioned functions that limits in method of the present invention.
In addition, said method step and system unit also can utilize controller and make controller realize that the computer readable storage devices of the computer program of above-mentioned steps or Elementary Function realizes for storage.
In addition, should be understood that, computer readable storage devices as herein described (for example, storer) can be volatile memory or nonvolatile memory, or can comprise volatile memory and nonvolatile memory.And nonrestrictive, nonvolatile memory can comprise ROM (read-only memory) (ROM), programming ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory as an example.Volatile memory can comprise random access memory (RAM), and this RAM can serve as the External Cache storer.As an example and nonrestrictive, RAM can obtain in a variety of forms, such as synchronous random access memory (DRAM), dynamic ram (DRAM), synchronous dram (SDRAM), double data rate SDRAM (DDR SDRAM), enhancing SDRAM (ESDRAM), synchronization link DRAM (SLDRAM) and direct RambusRAM (DRRAM).The memory device of disclosed aspect is intended to include but not limited to the storer of these and other suitable type.
Those skilled in the art will also understand is that, in conjunction with the described various illustrative logical blocks of disclosure herein, module, circuit and algorithm steps, may be implemented as electronic hardware, computer software or both combinations.For this interchangeability of hardware and software clearly is described, with regard to the function of various exemplary components, square, module, circuit and step, it has been carried out to general description.This function is implemented as software or is implemented as hardware and depends on concrete application and the design constraint that imposes on whole system.Those skilled in the art can realize described function in every way for every kind of concrete application, but this realization determines should not be interpreted as causing departing from the scope of the present invention.
In conjunction with the described various illustrative logical blocks of disclosure herein, module and circuit, can utilize the following parts that are designed to carry out function described here realize or carry out: general processor, digital signal processor (DSP), special IC (ASIC), field programmable gate array (FPGA) or other programmable logic device (PLD), discrete gate or transistor logic, discrete nextport hardware component NextPort or any combination of these parts.General processor can be microprocessor, but replacedly, processor can be any conventional processors, controller, microcontroller or state machine.Processor also may be implemented as the combination of computing equipment, and for example, the combination of DSP and microprocessor, multi-microprocessor, one or more microprocessor are in conjunction with DSP core or any other this configuration.
In the software module that can directly be included in hardware, be carried out by processor in conjunction with the step of the described method of disclosure herein or algorithm or in the two combination.Software module can reside in the storage medium of RAM storer, flash memory, ROM storer, eprom memory, eeprom memory, register, hard disk, removable dish, CD-ROM or any other form known in the art.Exemplary storage medium is coupled to processor, makes the processor can be from reading information this storage medium or to this storage medium writing information.In an alternative, described storage medium can be integral to the processor together.Processor and storage medium can reside in ASIC.ASIC can reside in user terminal.In an alternative, processor and storage medium can be used as discrete assembly and reside in user terminal.
In one or more exemplary design, described function can realize in hardware, software, firmware or its combination in any.If realize in software, described function can be transmitted on computer-readable medium or by computer-readable medium as one or more instructions or code storage.Computer-readable medium comprises computer-readable storage medium and communication media, and this communication media includes and helps computer program is sent to from a position any medium of another position.Storage medium can be can be by any usable medium of universal or special computer access.As an example and nonrestrictive, this computer-readable medium can comprise RAM, ROM, EEPROM, CD-ROM or other optical disc memory apparatus, disk storage device or other magnetic storage apparatus, or can be used to carry or file layout be instruction or data structure required program code and can be by any other medium of universal or special computing machine or universal or special processor access.In addition, any connection can suitably be called computer-readable medium.For example, if use coaxial cable, optical fiber cable, twisted-pair feeder, digital subscriber line (DSL) or such as the wireless technology of infrared ray, radio and microwave come from website, server or other remote source send software, above-mentioned coaxial cable, optical fiber cable, twisted-pair feeder, DSL or include the definition at medium such as the wireless technology of infrared first, radio and microwave.As used herein, disk and CD comprise compact disk (CD), laser disk, CD, digital versatile disc (DVD), floppy disk, Blu-ray disc, disk rendering data magnetically usually wherein, and cd-rom using laser optics ground rendering data.The combination of foregoing also should be included in the scope of computer-readable medium.
Although the disclosed content in front shows exemplary embodiment of the present invention, it should be noted that under the prerequisite of the scope of the present invention that does not deviate from the claim restriction, can carry out multiple change and modification.According to function, step and/or the action of the claim to a method of inventive embodiments described herein, need not carry out with any particular order.In addition, although element of the present invention can be with individual formal description or requirement, also it is contemplated that a plurality of, unless clearly be restricted to odd number.
Above-described embodiment; purpose of the present invention, technical scheme and beneficial effect are further described; institute is understood that; the foregoing is only the specific embodiment of the present invention; the protection domain that is not intended to limit the present invention; within the spirit and principles in the present invention all, any modification of making, be equal to replacement, improvement etc., within all should being included in protection scope of the present invention.

Claims (12)

1. an image converting method, is characterized in that, described method comprises:
Obtain the format information of picture;
According to described format information, judge whether described picture is the 9.png form;
If described picture is not the 9.png form, described picture is converted to the 9.png form.
2. image converting method according to claim 1, is characterized in that, before obtaining the format information of picture, described method also comprises:
Receive the picture load request;
Whether the picture that judges required loading according to described load request is the 9.png form;
If the picture that needs to load is the 9.png form, continue to obtain the format information of picture.
3. image converting method according to claim 1 and 2, is characterized in that, the described format information that obtains picture is: the format information that obtains the Target Photo corresponding with the picture load request.
4. image converting method according to claim 1, is characterized in that, describedly according to described format information, judges whether described picture is that the 9.png form comprises:
According to described format information, judge whether described picture is the png form;
If described picture is the png form, continue to judge whether described picture is the 9.png form;
If described picture is not the png form, judge that described picture is not the 9.png form.
5. image converting method according to claim 4, is characterized in that, describedly described picture is converted to the 9.png form comprises:
If described picture is the png form, by described picture, from the png format conversion, be the 9.png form;
If described picture is not the png form, first described picture is converted to the png form, then from the png format conversion, is the 9.png form by described picture.
6. image converting method according to claim 5, is characterized in that, described is that the 9.png form comprises by described picture from the png format conversion:
Data block that comprises 9.png information of picture structure according to the png form;
The data block that will comprise 9.png information is inserted in the data stream of picture of png form, obtains the picture of 9.png form.
7. a picture conversion equipment, is characterized in that, described device comprises:
The format information acquiring unit, be used to obtaining the format information of picture;
Whether the picture format judging unit is the 9.png form for according to described format information, judging described picture;
The picture format converting unit, for when described picture is not the 9.png form, be converted to the 9.png form by described picture.
8. picture conversion equipment according to claim 7, is characterized in that, described device also comprises:
The load request receiving element, be used to receiving the picture load request;
Whether the load request judging unit is the 9.png form for the picture that judges required loading according to described load request;
When described format information acquiring unit is the 9.png form for the picture that loads at needs, continue to obtain the format information of picture.
9. according to claim 7 or 8 described picture conversion equipments, is characterized in that, described format information acquiring unit is for obtaining the format information of Target Photo corresponding to picture load request.
10. picture conversion equipment according to claim 1, is characterized in that, described picture format judging unit comprises:
Whether the first judge module is the png form for according to described format information, judging described picture;
The second judge module, for when described picture is the png form, judge whether described picture is the 9.png form.
11. picture conversion equipment according to claim 10, is characterized in that, described picture format converting unit comprises:
The first modular converter, for when described picture is the png form, is the 9.png form by described picture from the png format conversion;
The second modular converter, while for described picture, not being the png form, be converted to the png form by described picture.
12. picture conversion equipment according to claim 11, is characterized in that, described the first modular converter is also for data block that comprises 9.png information of the structure of the picture according to the png form; And the data block that will comprise 9.png information is inserted in the data stream of picture of png form, obtains the picture of 9.png form.
CN201310280865.3A 2013-07-05 2013-07-05 A kind of image converting method and device Active CN103399864B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310280865.3A CN103399864B (en) 2013-07-05 2013-07-05 A kind of image converting method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310280865.3A CN103399864B (en) 2013-07-05 2013-07-05 A kind of image converting method and device

Publications (2)

Publication Number Publication Date
CN103399864A true CN103399864A (en) 2013-11-20
CN103399864B CN103399864B (en) 2017-11-07

Family

ID=49563494

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310280865.3A Active CN103399864B (en) 2013-07-05 2013-07-05 A kind of image converting method and device

Country Status (1)

Country Link
CN (1) CN103399864B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106709960A (en) * 2015-11-17 2017-05-24 北京国双科技有限公司 Image storage method, device and system
CN110597775A (en) * 2019-09-04 2019-12-20 广东浪潮大数据研究有限公司 Method and device for converting picture formats in deep learning platform
CN114185628A (en) * 2021-11-19 2022-03-15 北京奇艺世纪科技有限公司 Picture adjusting method, device and equipment of iOS system and computer readable medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101778270A (en) * 2009-01-13 2010-07-14 深圳市同洲电子股份有限公司 Method for accelerating the image displaying speed, system and digital television receiving terminal
CN101808182A (en) * 2010-02-05 2010-08-18 腾讯科技(深圳)有限公司 Method, terminal and system for uploading pictures
CN102932671A (en) * 2012-11-26 2013-02-13 北京奇虎科技有限公司 Method and server for supplying picture to computing terminal

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101778270A (en) * 2009-01-13 2010-07-14 深圳市同洲电子股份有限公司 Method for accelerating the image displaying speed, system and digital television receiving terminal
CN101808182A (en) * 2010-02-05 2010-08-18 腾讯科技(深圳)有限公司 Method, terminal and system for uploading pictures
CN102932671A (en) * 2012-11-26 2013-02-13 北京奇虎科技有限公司 Method and server for supplying picture to computing terminal

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
HUBINGFOREVER的日志: "个性缩放图片NinePatchDrawable", 《网易博客》 *
杜天廓: "PNG图像在嵌入式GUI中的解码分析与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106709960A (en) * 2015-11-17 2017-05-24 北京国双科技有限公司 Image storage method, device and system
CN110597775A (en) * 2019-09-04 2019-12-20 广东浪潮大数据研究有限公司 Method and device for converting picture formats in deep learning platform
CN114185628A (en) * 2021-11-19 2022-03-15 北京奇艺世纪科技有限公司 Picture adjusting method, device and equipment of iOS system and computer readable medium
CN114185628B (en) * 2021-11-19 2024-04-12 北京奇艺世纪科技有限公司 Picture adjustment method, device and equipment of iOS (integrated operation system) and computer readable medium

Also Published As

Publication number Publication date
CN103399864B (en) 2017-11-07

Similar Documents

Publication Publication Date Title
CN111510718B (en) Method and system for improving compression ratio through inter-block difference of image file
CN105279006B (en) Screen capture method and terminal based on Android system
EP3382578A1 (en) Two-dimensional code processing method and terminal
CN109816739B (en) Picture compression method, device, computer equipment and computer readable storage medium
CN105677259A (en) Method for storing file in mobile terminal and mobile terminal
CN103399864A (en) Image conversion method and device
KR102012937B1 (en) Apparatus and method for connecting an external device in a portable terminal
US11582173B2 (en) Message processing method and electronic device supporting the same
CN111510716B (en) Method and system for improving compression rate through pixel transformation of image file
CN104408503A (en) Processing method and system for two-dimensional code
CN110492935B (en) Data processing system, method and device and terminal equipment
CN110780898B (en) Page data upgrading method and device and electronic equipment
US20130311859A1 (en) System and method for enabling execution of video files by readers of electronic publications
US8615744B2 (en) Methods and system for managing assets in programming code translation
KR101538491B1 (en) Method and apparatus for using image as a means of storing and moving supplementary data
CN108304188B (en) Data type conversion method and terminal
CN113157277B (en) Host file processing method and device
KR20150107533A (en) Method and apparatus for outputting replacing electronic documents
KR102373135B1 (en) Operating Method For Text Message and Electronic Device supporting the same
KR102310069B1 (en) Cloud streaming system and apparatus and method for not a web format data reference in the system
CN117667863A (en) File storage method, device, storage medium and terminal
KR20190126031A (en) Operating Method For Text Message and Electronic Device supporting the same
CN117278693A (en) Image data processing circuit, method, electronic device, and medium
KR20150107531A (en) Method and apparatus for decoding an electronic document in mobile environment
JP2011008690A (en) File server device, computer program thereof, and data processing method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C53 Correction of patent of invention or patent application
CB02 Change of applicant information

Address after: 100102 Beijing Wangjing West Road, a volume of stone world building, A, block, floor 12

Applicant after: Xiaomi Technology Co., Ltd.

Address before: 100102 Beijing Wangjing West Road, a volume of stone world building, A, block, floor 12

Applicant before: Beijing Xiaomi Technology Co., Ltd.

C53 Correction of patent of invention or patent application
CB02 Change of applicant information

Address after: 100085 Beijing city Haidian District Qinghe Street No. 68 Huarun colorful city shopping center two floor 13

Applicant after: Xiaomi Technology Co., Ltd.

Address before: 100102 Beijing Wangjing West Road, a volume of stone world building, A, block, floor 12

Applicant before: Xiaomi Technology Co., Ltd.

COR Change of bibliographic data

Free format text: CORRECT: ADDRESS; FROM: 100102 CHAOYANG, BEIJING TO: 100085 HAIDIAN, BEIJING

GR01 Patent grant
GR01 Patent grant