Graphics file processing method, device, equipment and medium
By generating and registering tags for graphic files, the problem of bloated code caused by complex SVG file applications is solved, and efficient management and rapid invocation of graphic files in Web page development are achieved.
Patent Information
- Application Number
- CN202011448052.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-09
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2040-12-09
AI Technical Summary
The application of SVG files in Web page development is complicated, resulting in bloated system code and inconvenient management.
Generate tags by obtaining the content and identification information of the graphic file, and register these tags on the Web page to quickly call the graphic file through the identification information and avoid code redundancy.
It improves the management and use efficiency of graphics files, simplifies the calling and rendering methods of graphics files, avoids code redundancy, and achieves efficient management of graphics files in the Web page development process.
Smart Images

Figure CN112445478B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the technical field of computer data processing, and in particular, to a method, device, equipment and medium for processing a graphic file. Background Art
[0002] SVG (Scalable Vector Graphics) files are commonly used files in the process of web (World Wide Web) page development.
[0003] However, the current application of SVG files is complex, resulting in bloated system code and inconvenient management. Summary of the invention
[0004] The embodiments of the present disclosure provide a method, apparatus, device and medium for processing real-time graphic files to realize convenient application of graphic files.
[0005] In a first aspect, an embodiment of the present disclosure provides a method for processing a graphic file, the method comprising:
[0006] A method for processing a graphic file, characterized by comprising:
[0007] Acquire a graphic file, and generate a tag for the graphic file based on the content of the graphic file and identification information of the graphic file;
[0008] The tag of the graphic file is registered on a WEB page, wherein the registered tag is used to call the graphic file based on identification information of the graphic file.
[0009] In a second aspect, an embodiment of the present disclosure further provides a device for processing a graphic file, the device comprising:
[0010] A label generation module, used for acquiring a graphic file, and generating a label of the graphic file based on the content of the graphic file and the identification information of the graphic file;
[0011] The tag registration module is used to register the tag of the graphic file on the WEB page, wherein the registered tag is used to call the graphic file based on the identification information of the graphic file.
[0012] In a third aspect, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising:
[0013] one or more processors;
[0014] a storage device for storing one or more programs,
[0015] When the one or more programs are executed by the one or more processors, the one or more processors implement the method for processing a graphic file as described in any one of the embodiments of the present disclosure.
[0016] In a fourth aspect, the embodiments of the present disclosure further provide a storage medium comprising computer executable instructions, wherein the computer executable instructions, when executed by a computer processor, are used to execute the method for processing a graphic file as described in any one of the embodiments of the present disclosure.
[0017] The technical solution of the disclosed embodiment obtains the graphic file to be used, determines the content of the graphic file and the tag generated by the identification information of the graphic file, and registers the tag of the graphic file on the WEB page, so as to facilitate the rapid call of the graphic file through the identification information during the web page development process, improve the management and use efficiency of the graphic file, and avoid code redundancy during the use of the graphic file. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0019] Figure 1 A schematic diagram of a method for processing a graphic file provided in the first embodiment of the present disclosure;
[0020] Figure 2 A schematic diagram of a method for processing a graphic file provided in the second embodiment of the present disclosure;
[0021] Figure 3 A schematic diagram of the structure of a graphics file processing device provided in Embodiment 5 of the present disclosure;
[0022] Figure 4 This is a schematic diagram of the structure of an electronic device provided in Embodiment 6 of the present disclosure. DETAILED DESCRIPTION
[0023] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0024] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0025] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0026] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0027] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0028] Embodiment 1
[0029] Figure 1 This is a flow chart of a method for processing a graphic file provided in the first embodiment of the present disclosure. The embodiment of the present disclosure is applicable to the situation where interactive record data is generated based on user interaction information during the development of a web page. The method can be executed by a graphic file processing device, which can be implemented in the form of software and / or hardware, and optionally, by an electronic device, which can be a mobile terminal, a PC or a server, etc.
[0030] like Figure 1 , the method of this embodiment includes:
[0031] S110: Acquire a graphic file, and generate a tag for the graphic file based on content of the graphic file and identification information of the graphic file.
[0032] S120: Register the tag of the graphic file on a WEB page, wherein the registered tag is used to call the graphic file based on identification information of the graphic file.
[0033] In this embodiment, the graphic file is an svg file, which can be an icon file or a picture file, which is a scalable vector graphics file required for the web page to be developed. In some embodiments, the graphic file can be uploaded by the operating user and obtained through the HTML5 interface. In some embodiments, the graphic file can be pre-stored in the memory and called from the memory before the web page is developed. Optionally, multiple types of graphic files can be pre-stored in the memory, which can be at least one graphic file registered according to the type of the web page to be developed. Among them, the same graphic file can be applicable to different types of web pages.
[0034] Each acquired graphic file is configured with identification information, i.e., ID information, which can be a file name or code of the graphic file, etc., and is used to uniquely characterize each graphic file. The identification information of the graphic file can be preset by the user, or can be set in sequence according to the registration order or historical usage frequency of the graphic file. The identification information of the graphic file can be a string composed of any one or more of text, numbers, letters, symbols, etc.
[0035] By generating a tag for registering each graphic file based on the graphic file content and the identification information of the graphic file, and registering the tag of each graphic file on the web page to be developed, after registration, the graphic file can be quickly called and rendered on the web page through tag calling, which is convenient for the management and use of graphic files.
[0036] It should be noted that the acquired graphic file is a binary format file. Before generating a label, the binary format graphic file is converted into a string format file, and the label for registration is determined based on the string format graphic file and the identification information of the graphic file.
[0037] Optionally, generating a label for the graphic file based on the graphic file content and the identification information of the graphic file includes: performing regularization processing on the graphic file content and the identification information of the graphic file to obtain a label in a string format.
[0038] In this embodiment, the graphic file content (ie, the graphic file in string format) and identification information (ie, id information) are processed by a preset regular expression to obtain a symbol tag in string format.
[0039] Exemplarily, the regular expression used to process the graphic file may be:
[0040]
[0041] By calling the registration instruction, the symbol tag of each graphic file is registered on the web page. For example, taking the registered graphic file as an icon file, the registration instruction may be addSvgSymbolIconBox.innerHTML+=iconHtml.
[0042] Optionally, before registering the tag of the graphic file on the WEB page, the method further includes: determining whether a registration container for the tag is set on the WEB page; if not, creating the registration container. By determining the registration container in advance, it is determined that a registration container for the tag is set on the WEB page, or a registration container for the registered tag is set, to avoid the situation where the registration fails due to the absence of a registration container when registering the tag.
[0043] After a registration container is set or created on a WEB page, the tag of the graphic file is registered in the registration container. After the tag of the graphic file is successfully registered, any registered graphic file can be called by the identification information calling instruction and rendered on the WEB page, replacing the situation of calling the graphic file by address, which is convenient for efficient calling and management of graphic files.
[0044] The technical solution of the disclosed embodiment obtains the graphic file to be used, determines the content of the graphic file and the tag generated by the identification information of the graphic file, and registers the tag of the graphic file on the WEB page, so as to facilitate the rapid call of the graphic file through the identification information during the web page development process, improve the management and use efficiency of the graphic file, and avoid code redundancy during the use of the graphic file.
[0045] Embodiment 2
[0046] Figure 2 This is a flow chart of a method for processing a graphic file provided in the second embodiment of the present disclosure. This embodiment is optimized based on the above embodiment. Figure 2 As shown, the method includes:
[0047] S210: Acquire a graphic file, and generate a tag for the graphic file based on content of the graphic file and identification information of the graphic file.
[0048] S220: registering the tag of the graphic file on a WEB page.
[0049] S230: Receive a graphic file calling instruction carrying identification information, and call a graphic file corresponding to the identification information according to the identification information in the graphic file calling instruction and a registered tag.
[0050] S240: Render the called graphic file on the WEB page.
[0051] In this embodiment, the properties of the graphic file are set, for example, each graphic file is set with a color adaptive property and a size adaptive property. Among them, the color adaptive property is used to automatically determine the color of the rendering when the graphic file is called, and similarly, the size adaptive property is used to automatically determine the size of the rendering (such as the width and height of the rendering) when the graphic file is called, without other settings, which is convenient and fast, and improves the convenience of the graphic file in the use process.
[0052] The color adaptation attribute and size adaptation attribute of the graphic file may be pre-set before uploading the graphic file, or may be set before registration. Exemplarily, before registering the tag of the graphic file, it is determined whether the color adaptation attribute and size adaptation attribute are set in each graphic file. If so, the tag of the graphic file is directly registered. If not, the attribute is set for the graphic file that does not have the color adaptation attribute and size adaptation attribute set.
[0053] Optionally, the color adaptation property can be set via fill:currentColor and the size adaptation property can be set in em units.
[0054] Correspondingly, rendering the called graphic file on the WEB page includes: traversing the parent tags of the called graphic file in turn, obtaining the color attribute and size attribute in the parent tag; and rendering the graphic file based on the color attribute and size attribute in the parent tag. Specifically, a calling instruction of a graphic file is received, and the calling instruction is configured with identification information of the called graphic file. Exemplarily, the calling instruction of the graphic file can be<usehref={id}> . Determine the corresponding registered tag by using the identification information (i.e., id information) in the calling instruction, determine the content of the graphic file based on the registered tag, and render the content of the graphic file. Among them, automatically obtain the size attributes and color attributes of the graphic file, and perform adaptive rendering. Specifically, determine the parent tag of the current tag to be rendered, and when the parent tag exists, determine the color attributes and size attributes in the parent tag. It should be noted that if the current parent tag does not have one or more of the color attributes and size attributes, further determine the parent tag of the current parent tag based on the nested relationship between the tags, and traverse each parent tag with a nested relationship until the color attributes and size attributes are determined or the previous parent tag does not exist, and stop traversing. Optionally, the determined color attributes and size attributes are determined as the color attributes and size attributes of the current tag to be rendered (i.e., the graphic file). Optionally, according to the attribute setting rules between the parent tag and the child tag, the color attribute and size attribute of the tag to be rendered are determined based on the color attribute and size attribute of the parent tag. For example, taking the size attribute as an example, the size of the child tag can be smaller than the size of the parent tag, for example, it can be determined by reducing 1em. It should be noted that the attribute setting rules can be set in advance according to the requirements of the web page, and can also be set according to the type of graphic file, and there is no limitation on this.
[0055] When the color attribute and / or size attribute cannot be determined by traversing each parent tag, or when there is no parent tag, the preset default color attribute and / or default size attribute is obtained, and the called graphic file is rendered based on the default color attribute and / or default size attribute. The default color attribute and the default size attribute can be set according to the type of the graphic file, or the type of the web page, or based on the rendering position of the graphic file, which is not limited.
[0056] Adjust the rendering size of the graphic file according to the determined size attributes, replace the original color of the graphic file through the color attribute, and render it quickly and conveniently.
[0057] It should be noted that the properties of the graphic file also include but are not limited to the vertical alignment property and the element overflow hidden property. By setting the vertical alignment property, each rendered graphic file is vertically aligned to improve the neatness of the web page. By setting the element overflow hidden property, the content beyond the element box is hidden to improve the neatness of the web page.
[0058] In some embodiments, after registering the tag of the graphic file on the WEB page, the method further includes: displaying the correspondence between the identification information corresponding to the registered tag and the sample image of the graphic file in a preset area of the WEB page. When there are a large number of registered graphic files, in order to avoid confusion in the correspondence between the identification information and the graphic file, which may lead to errors in calling the graphic file, the identification information corresponding to the registered tag and the sample image of the graphic file may be displayed in the preset area of the WEB page, so that the user can intuitively determine the identification information corresponding to each graphic file and improve the accuracy of the calling instruction. The preset area of the WEB page may be a toolbar area of the display interface, or other pre-set display area.
[0059] In some embodiments, after registering the tag of the graphic file on a WEB page, the method further includes: setting a call control or call instruction for the correspondence between the identification information corresponding to the registered tag and the sample image of the graphic file, wherein the call control or call instruction is used to trigger the display of the correspondence between the identification information corresponding to the registered tag and the sample image of the graphic file. In order to avoid the space occupation of the display interface by normal display, the display area for the correspondence between the identification information corresponding to the registered tag and the sample image of the graphic file is hidden, and a call control or call instruction for triggering the display area is set, which may be a pre-set virtual button, or a trigger gesture or a trigger track, etc. When it is detected that the call control is clicked or a call instruction input such as a trigger gesture or a trigger track is detected, the display area is triggered to display, so that the user can view the correspondence between the graphic file and the identification information.
[0060] The technical solution provided by this embodiment simplifies the calling and rendering methods of graphic files by registering the tags of various graphic files on the web page, calling the graphic files through calling instructions including identification information, and adaptively determining the rendering properties of the graphic files. It is no longer necessary to use SVG background images and SVG DOM rendering methods, thus avoiding the problem of bloated code in the process of managing and using graphic files, and facilitating the management and use of graphic files.
[0061] Embodiment 3
[0062] Figure 3Schematic diagram of a graphic file processing device provided by Embodiment 5 of the present disclosure. Figure 3 As shown, the device includes: a label generation module 310 and a label registration module 320.
[0063] The label generation module 310 is used to obtain a graphic file and generate a label for the graphic file based on the content of the graphic file and the identification information of the graphic file;
[0064] The tag registration module 320 is used to register the tag of the graphic file on the WEB page, wherein the registered tag is used to call the graphic file based on the identification information of the graphic file.
[0065] The technical solution of the disclosed embodiment obtains the graphic file to be used through a label generation module, determines the graphic file content and the label generated by the identification information of the graphic file, and registers the label of the graphic file on the WEB page through a label registration module, so as to facilitate the rapid call of the graphic file through the identification information during the web page development process, improve the management and use efficiency of the graphic file, and avoid code redundancy during the use of the graphic file.
[0066] Based on the above technical solution, the label generation module 310 is used to:
[0067] Regularization is performed on the graphic file content and the identification information of the graphic file to obtain a label in a string format.
[0068] On the basis of the above technical solution, the device also includes:
[0069] A container determination module, used for determining whether a registration container of the tag is set on the WEB page before registering the tag of the graphic file on the WEB page;
[0070] The container creation module is used to create the registration container if the registration container with the tag is not set on the WEB page.
[0071] On the basis of the above technical solution, the device also includes:
[0072] A graphic file calling module, for receiving a graphic file calling instruction carrying identification information after registering the tag of the graphic file on a WEB page, and calling the graphic file corresponding to the identification information according to the identification information in the graphic file calling instruction and the registered tag;
[0073] The graphic file rendering module is used to render the called graphic file on the WEB page.
[0074] Based on the above technical solution, the graphic file is provided with a color adaptive attribute and a size adaptive attribute.
[0075] Based on the above technical solution, the graphics file rendering module is used to:
[0076] Traverse the parent tags of the called graphic file in sequence to obtain the color attribute and size attribute in the parent tag;
[0077] The graphic file is rendered based on the color attribute and the size attribute in the parent tag.
[0078] On the basis of the above technical solution, the device also includes:
[0079] A first display module, for displaying the corresponding relationship between the identification information corresponding to the registered tag and the sample image of the graphic file in a preset area of the WEB page after the tag of the graphic file is registered on the WEB page;
[0080] On the basis of the above technical solution, the device also includes:
[0081] The second display module is used to set a calling control or calling instruction for setting the correspondence between the identification information corresponding to the registered tag and the example image of the graphic file, wherein the calling control or calling instruction is used to trigger the display of the correspondence between the identification information corresponding to the registered tag and the example image of the graphic file.
[0082] The device provided by the embodiments of the present disclosure can execute the method provided by any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0083] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present disclosure.
[0084] Embodiment 4
[0085] Reference below Figure 4 , which shows an electronic device (eg, Figure 4 The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 4The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0086] like Figure 4 As shown, the electronic device 400 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 401, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 402 or a program loaded from a storage device 408 into a random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the electronic device 400 are also stored. The processing device 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0087] Typically, the following devices may be connected to the I / O interface 405: an input device 406 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 407 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 408 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 409. The communication device 409 may allow the electronic device 400 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 4 The electronic device 400 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0088] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 409, or installed from the storage device 408, or installed from the ROM402. When the computer program is executed by the processing device 401, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0089] The electronic device provided by the embodiment of the present disclosure and the method for processing graphic files provided by the above embodiment belong to the same inventive concept. The technical details not fully described in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
[0090] Embodiment 5
[0091] An embodiment of the present disclosure provides a computer storage medium on which a computer program is stored. When the program is executed by a processor, the method for processing a graphic file provided in the above embodiment is implemented.
[0092] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0093] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0094] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0095] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device:
[0096] Acquire a graphic file, and generate a tag for the graphic file based on the content of the graphic file and identification information of the graphic file;
[0097] The tag of the graphic file is registered on a WEB page, wherein the registered tag is used to call the graphic file based on identification information of the graphic file.
[0098] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0099] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0100] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit / module does not, in some cases, constitute a limitation on the unit itself.
[0101] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0102] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0103] According to one or more embodiments of the present disclosure, [Example 1] provides a method for processing a graphic file, the method comprising:
[0104] Acquire a graphic file, and generate a tag for the graphic file based on the content of the graphic file and identification information of the graphic file;
[0105] The tag of the graphic file is registered on a WEB page, wherein the registered tag is used to call the graphic file based on identification information of the graphic file.
[0106] According to one or more embodiments of the present disclosure, [Example 2] provides a method for processing a graphic file, further comprising:
[0107] Optionally, generating the label of the graphic file based on the graphic file content and the identification information of the graphic file includes: performing regularization processing on the graphic file content and the identification information of the graphic file to obtain the label in a string format.
[0108] According to one or more embodiments of the present disclosure, [Example 3] provides a method for processing a graphic file, further comprising:
[0109] Before registering the tag of the graphic file on the WEB page, the method further includes: determining whether a registration container of the tag is set on the WEB page; if not, creating the registration container.
[0110] According to one or more embodiments of the present disclosure, [Example 4] provides a method for processing a graphic file, further comprising:
[0111] Optionally, after registering the tag of the graphic file on the WEB page, the method further includes: receiving a graphic file calling instruction carrying identification information, calling the graphic file corresponding to the identification information according to the identification information in the graphic file calling instruction and the registered tag; and rendering the called graphic file on the WEB page.
[0112] According to one or more embodiments of the present disclosure, [Example 5] provides a method for processing a graphic file, further comprising:
[0113] Optionally, the graphic file is provided with a color adaptive attribute and a size adaptive attribute.
[0114] According to one or more embodiments of the present disclosure, [Example 6] provides a method for processing a graphic file, further comprising:
[0115] Optionally, rendering the called graphic file on the WEB page includes: traversing the parent tags of the called graphic file in sequence to obtain color attributes and size attributes in the parent tags; rendering the graphic file based on the color attributes and size attributes in the parent tags.
[0116] According to one or more embodiments of the present disclosure, [Example 7] provides a method for processing a graphic file, further comprising:
[0117] Optionally, after registering the tag of the graphic file on the WEB page, the method further comprises: displaying the correspondence between the identification information corresponding to the registered tag and the example diagram of the graphic file in a preset area of the WEB page.
[0118] According to one or more embodiments of the present disclosure, [Example 8] provides a method for processing a graphic file, further comprising:
[0119] Optionally, after registering the tag of the graphic file on a WEB page, the method further includes: setting a calling control or calling instruction for a correspondence between the identification information corresponding to the registered tag and the example image of the graphic file, wherein the calling control or calling instruction is used to trigger the display of the correspondence between the identification information corresponding to the registered tag and the example image of the graphic file.
[0120] According to one or more embodiments of the present disclosure, [Example 9] provides a device for processing a graphic file, the device comprising:
[0121] A label generation module, used for acquiring a graphic file, and generating a label of the graphic file based on the content of the graphic file and the identification information of the graphic file;
[0122] The tag registration module is used to register the tag of the graphic file on the WEB page, wherein the registered tag is used to call the graphic file based on the identification information of the graphic file.
[0123] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0124] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0125] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A method for processing a graphic file, characterized in that: include: Acquire a graphic file, and generate a tag for the graphic file based on the content of the graphic file and identification information of the graphic file; The identification information is ID information, which is used to uniquely characterize each graphic file; the label of the graphic file is obtained by regularizing the content of the graphic file and the identification information of the graphic file; Registering the tag of the graphic file on a WEB page, wherein the registered tag is used to call the graphic file based on the identification information of the graphic file; After registering the tag of the graphic file on the WEB page, the method further comprises: receiving a graphic file calling instruction carrying identification information, and calling a graphic file corresponding to the identification information according to the identification information in the graphic file calling instruction and a registered tag; Render the called graphic file on the WEB page; The graphic file is provided with a color adaptive attribute and a size adaptive attribute; wherein the color adaptive attribute is used to automatically determine the color of the rendering for rendering when the graphic file is called, and the size adaptive attribute is used to automatically determine the size of the rendering for rendering when the graphic file is called; The color adaptation attribute and the size adaptation attribute are preset before the graphic file is uploaded; or, are preset before the graphic file is registered.
2. The method according to claim 1, characterized in that The step of generating a label of the graphic file based on the graphic file content and the identification information of the graphic file includes: Regularization is performed on the graphic file content and the identification information of the graphic file to obtain a label in a string format.
3. The method according to claim 1, characterized in that Before registering the tag of the graphic file on the WEB page, the method further comprises: Determine whether a registration container of the tag is set on the WEB page; If the registration container with the tag is not set on the WEB page, the registration container is created.
4. The method according to claim 1, characterized in that: The called graphic file is rendered on the WEB page, including: Traverse the parent tags of the called graphic file in sequence to obtain the color attribute and size attribute in the parent tag; The graphic file is rendered based on the color attribute and the size attribute in the parent tag.
5. The method according to claim 1, characterized in that After registering the tag of the graphic file on the WEB page, the method further comprises: Displaying the correspondence between the identification information corresponding to the registered tag and the sample image of the graphic file in a preset area of the WEB page; or, A calling control or calling instruction is set for the correspondence between the identification information corresponding to the registered tag and the example image of the graphic file, wherein the calling control or calling instruction is used to trigger the display of the correspondence between the identification information corresponding to the registered tag and the example image of the graphic file.
6. A graphics file processing device, characterized in that: include: A label generation module, used for acquiring a graphic file, and generating a label of the graphic file based on the content of the graphic file and the identification information of the graphic file; The identification information is ID information, which is used to uniquely characterize each graphic file; The label of the graphic file is obtained by regularizing the content of the graphic file and the identification information of the graphic file; A tag registration module, used to register the tag of the graphic file on a WEB page, wherein the registered tag is used to call the graphic file based on the identification information of the graphic file; A graphic file calling module, for receiving a graphic file calling instruction carrying identification information after registering the tag of the graphic file on a WEB page, and calling the graphic file corresponding to the identification information according to the identification information in the graphic file calling instruction and the registered tag; Graphics file rendering module, used to render the called graphics file on the WEB page; The graphic file is provided with a color adaptive attribute and a size adaptive attribute; wherein the color adaptive attribute is used to automatically determine the color of the rendering for rendering when the graphic file is called, and the size adaptive attribute is used to automatically determine the size of the rendering for rendering when the graphic file is called; The color adaptation attribute and the size adaptation attribute are preset before the graphic file is uploaded; or, are preset before the graphic file is registered.
7. An electronic device, characterized in that: The electronic device comprises: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method for processing a graphic file as described in any one of claims 1 to 5.
8. A storage medium comprising computer executable instructions, wherein the computer executable instructions are used to execute the method for processing a graphic file as claimed in any one of claims 1 to 5 when executed by a computer processor.
