CN112954011B - Image resource compression method and device and electronic equipment - Google Patents
Image resource compression method and device and electronic equipment Download PDFInfo
- Publication number
- CN112954011B CN112954011B CN202110110012.XA CN202110110012A CN112954011B CN 112954011 B CN112954011 B CN 112954011B CN 202110110012 A CN202110110012 A CN 202110110012A CN 112954011 B CN112954011 B CN 112954011B
- Authority
- CN
- China
- Prior art keywords
- resource file
- image resource
- folder
- image
- instruction 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.)
- Active
Links
- 238000007906 compression Methods 0.000 title claims abstract description 47
- 230000006835 compression Effects 0.000 title claims abstract description 43
- 238000000034 method Methods 0.000 title claims abstract description 36
- 238000004422 calculation algorithm Methods 0.000 claims abstract description 9
- 230000002452 interceptive effect Effects 0.000 claims description 19
- 238000006243 chemical reaction Methods 0.000 claims description 3
- 238000012545 processing Methods 0.000 abstract description 21
- 230000006870 function Effects 0.000 abstract description 5
- 238000010586 diagram Methods 0.000 description 10
- 238000004590 computer program Methods 0.000 description 4
- 238000001514 detection method Methods 0.000 description 4
- 230000004048 modification Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 230000006872 improvement Effects 0.000 description 2
- 239000013307 optical fiber Substances 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 238000007792 addition Methods 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 230000003252 repetitive effect Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
- H04L67/565—Conversion or adaptation of application format or content
- H04L67/5651—Reducing the amount or size of exchanged application data
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/06—Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
- H04L67/565—Conversion or adaptation of application format or content
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/04—Protocols for data compression, e.g. ROHC
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Information Transfer Between Computers (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The application relates to the technical field of computers, in particular to an image resource compression method, an image resource compression device and electronic equipment, which comprise the following steps: acquiring instruction information; calling a corresponding tool package to execute a script task according to the instruction information, and obtaining an image resource file; converting the image resource file into an image resource file with a preset data format; and compressing the image resource file in the preset data format according to an image compression algorithm to generate a new compressed image resource file. The application can intelligently identify the image resources, has simple and efficient compression process, has batch processing and deep scanning automatic processing functions, occupies small operation space when in operation, automatically completes instruction operation, uploading resources and downloading resources, improves the working efficiency, and can self-define the compression configuration parameters.
Description
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for compressing image resources, and an electronic device.
Background
Currently, most image resource compression tools need to install corresponding application programs under various systems according to different operating systems, and occupy space and computer running memory during the period that the programs are not used; the method can not automatically and intelligently identify the image resources when compressing the image resources, and the compressed application program is required to be installed and opened to manually operate the click file operation and the compression treatment, so that the use program is complicated and not efficient; in many image resource compression approaches, not only registration and login are needed to become member users, but also many functions can take charging means for users, and many channels for compressing image resources through a official network are needed for users to upload resources to a server for processing and then download the resources for processing, so that a great deal of flow loss and waste are caused, the compression procedure is difficult and difficult due to complicated flow, and the stability of downloading is poor and the efficiency is low after uploading, compressing and downloading.
Disclosure of Invention
The application provides the image resource compression method, the device and the electronic equipment, which realize the simplicity and high efficiency of the compression process, have the functions of batch processing and deep scanning automatic processing, occupy small operation space during operation, automatically complete instruction operation, uploading resources and downloading resources, improve the working efficiency and can self-define the compression configuration parameters.
The embodiment of the specification provides an image resource compression method, which comprises the following steps:
acquiring instruction information;
calling a corresponding tool package to execute a script task according to the instruction information, and obtaining an image resource file;
converting the image resource file into an image resource file with a preset data format;
and compressing the image resource file in the preset data format according to an image compression algorithm to generate a new compressed image resource file.
Preferably, the calling the corresponding tool kit to execute the script task according to the instruction information includes:
calling a corresponding package management tool according to the instruction information;
the package management tool executes the script task according to the instruction information.
Preferably, the packet management tool performs the script task according to the instruction information, including:
identifying a file to be identified;
and when the file is a first folder, entering an interactive option to identify the first folder.
Preferably, the entering the interactive option identifies the image resource file, including:
and when the first folder does not need to be scanned, the identified first folder is the image resource file.
Preferably, the entering the interactive option identifies the image resource file, including:
when the first folder needs to be scanned, scanning all files in the first folder;
and intelligently identifying all files in the first folder, and identifying the image resource files in the first folder.
Preferably, the intelligent identification of all files in the first folder includes:
and when all the files in the identified first folder are second folders, intelligently identifying all the files in the second folders until the image resource files are identified.
Preferably, the acquiring the image resource file includes:
intelligent identification and detection are carried out on the image resource file;
and acquiring the identified and detected image resource file.
Preferably, the preset data format includes: 16-ary data format, 64-ary data format, buffer data format.
Preferably, the generating a new compressed image resource file includes:
and generating a new compressed image resource file according to the instruction path in the instruction information.
The embodiment of the present specification also provides an image resource compression device, which is characterized by comprising:
the instruction acquisition module acquires instruction information;
the tool package calling module calls a corresponding tool package to execute a script task according to the instruction information, and an image resource file is obtained;
the resource file conversion module is used for converting the image resource file into an image resource file with a preset data format;
and the resource file compression module is used for compressing the image resource file in the preset data format according to an image compression algorithm to generate a new compressed image resource file.
Preferably, the calling the corresponding tool kit to execute the script task according to the instruction information includes:
calling a corresponding package management tool according to the instruction information;
the package management tool executes the script task according to the instruction information.
Preferably, the packet management tool performs the script task according to the instruction information, including:
identifying a file to be identified;
and when the file is a first folder, entering an interactive option to identify the first folder.
Preferably, the entering the interactive option identifies the image resource file, including:
and when the first folder does not need to be scanned, the identified first folder is the image resource file.
Preferably, the entering the interactive option identifies the image resource file, including:
when the first folder needs to be scanned, scanning all files in the first folder;
and intelligently identifying all files in the first folder, and identifying the image resource files in the first folder.
Preferably, the intelligent identification of all files in the first folder includes:
and when all the files in the identified first folder are second folders, intelligently identifying all the files in the second folders until the image resource files are identified.
Preferably, the acquiring the image resource file includes:
intelligent identification and detection are carried out on the image resource file;
and acquiring the identified and detected image resource file.
Preferably, the preset data format includes: 16-ary data format, 64-ary data format, buffer data format.
Preferably, the generating a new compressed image resource file includes:
and generating a new compressed image resource file according to the instruction path in the instruction information.
An electronic device, wherein the electronic device comprises:
a processor and a memory storing computer executable instructions that, when executed, cause the processor to perform the method of any of the above.
A computer readable storage medium storing one or more programs which, when executed by a processor, implement the method of any of the preceding claims.
The beneficial effects are that:
the application can intelligently identify the image resources, has simple and efficient compression process, has batch processing and deep scanning automatic processing functions, occupies small operation space when in operation, automatically completes instruction operation, uploading resources and downloading resources, improves the working efficiency, and can self-define the compression configuration parameters.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute a limitation on the application. In the drawings:
fig. 1 is a schematic diagram of an image resource compression method according to an embodiment of the present disclosure;
fig. 2 is a schematic structural diagram of an image resource compressing apparatus according to an embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure;
fig. 4 is a schematic diagram of a computer readable medium according to an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present application will now be described more fully with reference to the accompanying drawings. However, the exemplary embodiments can be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these exemplary embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the application to those skilled in the art. The same reference numerals in the drawings denote the same or similar elements, components or portions, and thus a repetitive description thereof will be omitted.
The features, structures, characteristics or other details described in a particular embodiment do not exclude that may be combined in one or more other embodiments in a suitable manner, without departing from the technical idea of the application.
In the description of specific embodiments, features, structures, characteristics, or other details described in the present application are provided to enable one skilled in the art to fully understand the embodiments. However, it is not excluded that one skilled in the art may practice the present application without one or more of the specific features, structures, characteristics, or other details.
The drawings shown in the figures are merely exemplary and do not necessarily include all of the content and operations/steps nor must they be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the order of actual execution may be changed according to actual situations.
The block diagrams depicted in the figures are merely functional entities and do not necessarily correspond to physically separate entities. That is, the functional entities may be implemented in software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
The term "and/or" and/or "includes all combinations of any one or more of the associated listed items.
Referring to fig. 1, a schematic diagram of an image resource compression method according to an embodiment of the present disclosure includes:
s101: acquiring instruction information;
in the preferred embodiment of the application, when the method is implemented, the running environment of the node is installed on the computer in advance, and the npm packet management tool is installed, so that when a user inputs a command at the terminal, the terminal can read the command information input by the user.
S102: calling a corresponding tool package to execute a script task according to the instruction information, and obtaining an image resource file;
in a preferred embodiment of the present application, after obtaining instruction information input by a user, the terminal sends the obtained instruction information to the npm packet management tool, and the npm packet management tool executes a script task corresponding to the instruction information according to the instruction information, detects a resource file, determines a type of the resource file, and identifies the resource file by an intelligent identification method, thereby obtaining an image resource file.
S103: converting the image resource file into an image resource file with a preset data format;
in a preferred embodiment of the present application, the terminal converts the obtained image resource file into an image resource file with a preset data format, where the preset data format includes, but is not limited to, a 16-ary data format, a 64-ary data format, a buffer data format, and the like.
S104: and compressing the image resource file in the preset data format according to an image compression algorithm to generate a new compressed image resource file.
In the preferred embodiment of the application, the image resource file with the preset data format is compressed according to the image compression algorithm to generate a new compressed image resource file, so that the flow loss is reduced, and the stability and the processing efficiency of the terminal in the uploading and downloading processes of the image resource file are ensured.
Further, the calling the corresponding tool kit to execute the script task according to the instruction information comprises the following steps:
calling a corresponding package management tool according to the instruction information;
the package management tool executes the script task according to the instruction information.
In a preferred embodiment of the application, the terminal calls a corresponding package management tool according to the instruction information, and then the package management tool executes the script task according to the instruction information, wherein the script task comprises identification of a file to be detected, and when the identified resource file is a folder, the terminal enters an interactive option to carry out deep identification on the folder to obtain an image resource file; and when the identified resource file is a resource file, intelligently identifying the resource file, and identifying the image resource file in the resource file.
Further, the package management tool performs the script task according to the instruction information, including:
identifying a file to be identified;
and when the file is a first folder, entering an interactive option to identify the first folder.
In the preferred embodiment of the application, when the interactive option is entered to identify the folder, whether the folder needs to be scanned or not is judged, and when the folder does not need to be scanned, the identified folder is a resource file; when the folder needs to be scanned, all files in the folder are scanned, and all files in the folder are intelligently identified until the resource files in the folder are identified.
Further, the entering interactive option identifies the image resource file, including:
and when the first folder does not need to be scanned, the identified first folder is the image resource file.
In a preferred embodiment of the present application, when entering the interactive option identification image resource file, a determination is made as to whether to perform depth scanning in advance, and when depth scanning is not required, the identified folder is the resource file
Further, the entering interactive option identifies the image resource file, including:
when the first folder needs to be scanned, scanning all files in the first folder;
and intelligently identifying all files in the first folder, and identifying the image resource files in the first folder.
In the preferred embodiment of the application, when the interactive option is entered to identify the image resource file, the judgment of whether to perform the deep scanning is needed, and when the folder needs to be scanned, all files in the folder are scanned, and all files in the folder are intelligently identified until the resource file in the folder is identified.
Further, the intelligent identification of all files in the first folder comprises the following steps:
and when all the files in the identified first folder are second folders, intelligently identifying all the files in the second folders until the image resource files are identified.
In the preferred embodiment of the present application, since other folders exist in the folders and other folders also exist in the other folders, when the resource file in the folder is not recognized for the first time, the resource file needs to be recognized in the other folders in the folder, and if the resource file is still not recognized, the scanning recognition is continued to be performed on the other folders also existing in the other folders until the image resource file is recognized. The method comprises the steps of identifying and compressing a plurality of files and folders in a mixed mode target resource specification.
Further, the acquiring the image resource file includes:
intelligent identification and detection are carried out on the image resource file;
and acquiring the identified and detected image resource file.
In a preferred embodiment of the present application,
further, the preset data format includes: 16-ary data format, 64-ary data format, buffer data format.
In the preferred embodiment of the application, the resource files with different formats such as 16-system data format, 64-system data format, buffer data format and the like are converted to realize different format requirements of the terminal,
further, the generating a new compressed image source file includes:
and generating a new compressed image resource file according to the instruction path in the instruction information.
In a preferred embodiment of the present application, the instruction information input by the terminal includes an instruction path, and the compressed image resource file is stored to the designated position through the instruction path, so that the compression and storage of the image resource file based on the terminal instruction information are completed.
In a preferred embodiment of the present application, the compression parameters may be configured, including specifying target resources, compression ratio, output path, etc. The compression is freely set, and the flexibility is higher.
In the preferred embodiment of the application, the application supports cross-platform use, is compatible with most systems, does not need to be developed again for different systems, and has strong compatibility; the method has the advantages that the method is simple in operation, the files do not need to be selected one by one, scanning identification is completed directly according to instruction automation, the occupied memory is small when the instruction task operates, the corresponding occupied operation space is small, and the operation memory is not influenced; only a npm package management tool with a small node.js running environment installation is needed; the method has the advantages of intelligently identifying and compressing the mixed mode target resource of a plurality of files and folders.
The operation processes of uploading image resources, downloading resources and the like are omitted, and fig. 2 is a schematic structural diagram of an image resource compression device provided in an embodiment of the present disclosure, where the schematic structural diagram includes:
an instruction acquisition module 201 that acquires instruction information;
in the preferred embodiment of the application, when the method is implemented, the running environment of the node is installed on the computer in advance, and the npm packet management tool is installed, so that when a user inputs a command at the terminal, the terminal can read the command information input by the user.
The tool pack calling module 202 calls a corresponding tool pack to execute a script task according to the instruction information to acquire an image resource file;
in a preferred embodiment of the present application, after obtaining instruction information input by a user, the terminal sends the obtained instruction information to the npm packet management tool, and the npm packet management tool executes a script task corresponding to the instruction information according to the instruction information, detects a resource file, determines a type of the resource file, and identifies the resource file by an intelligent identification method, thereby obtaining an image resource file.
The resource file conversion module 203 converts the image resource file into an image resource file with a preset data format;
in a preferred embodiment of the present application, the terminal converts the obtained image resource file into an image resource file with a preset data format, where the preset data format includes, but is not limited to, a 16-ary data format, a 64-ary data format, a buffer data format, and the like.
The resource file compression module 204 compresses the image resource file with the preset data format according to an image compression algorithm to generate a new compressed image resource file.
In the preferred embodiment of the application, the image resource file with the preset data format is compressed according to the image compression algorithm to generate a new compressed image resource file, so that the flow loss is reduced, and the stability and the processing efficiency of the terminal in the uploading and downloading processes of the image resource file are ensured.
Further, the calling the corresponding tool kit to execute the script task according to the instruction information comprises the following steps:
calling a corresponding package management tool according to the instruction information;
the package management tool executes the script task according to the instruction information.
Further, the package management tool performs the script task according to the instruction information, including:
identifying a file to be identified;
and when the file is a first folder, entering an interactive option to identify the first folder.
Further, the entering interactive option identifies the image resource file, including:
and when the first folder does not need to be scanned, the identified first folder is the image resource file.
Further, the entering interactive option identifies the image resource file, including:
when the first folder needs to be scanned, scanning all files in the first folder;
and intelligently identifying all files in the first folder, and identifying the image resource files in the first folder.
Further, the intelligent identification of all files in the first folder comprises the following steps:
and when all the files in the identified first folder are second folders, intelligently identifying all the files in the second folders until the image resource files are identified.
Further, the acquiring the image resource file includes:
intelligent identification and detection are carried out on the image resource file;
and acquiring the identified and detected image resource file.
Further, the preset data format includes: 16-ary data format, 64-ary data format, buffer data format.
Further, the generating a new compressed image source file includes:
and generating a new compressed image resource file according to the instruction path in the instruction information.
The application can intelligently identify the image resources, has simple and efficient compression process, has batch processing and deep scanning automatic processing functions, occupies small operation space when in operation, automatically completes instruction operation, uploading resources and downloading resources, improves the working efficiency, and can self-define the compression configuration parameters.
Based on the same inventive concept, the embodiments of the present specification also provide an electronic device.
The following describes an embodiment of an electronic device according to the present application, which may be regarded as a specific physical implementation of the above-described embodiment of the method and apparatus according to the present application. Details described in relation to the embodiments of the electronic device of the present application should be considered as additions to the embodiments of the method or apparatus described above; for details not disclosed in the embodiments of the electronic device of the present application, reference may be made to the above-described method or apparatus embodiments.
Referring to fig. 3, a schematic structural diagram of an electronic device according to an embodiment of the present disclosure is provided. An electronic device 300 according to this embodiment of the present application is described below with reference to fig. 3. The electronic device 300 shown in fig. 3 is merely an example and should not be construed as limiting the functionality and scope of use of embodiments of the present application.
As shown in fig. 3, the electronic device 300 is embodied in the form of a general purpose computing device. Components of electronic device 300 may include, but are not limited to: at least one processing unit 310, at least one memory unit 320, a bus 330 connecting the different device components (including the memory unit 320 and the processing unit 310), a display unit 340, and the like.
Wherein the storage unit stores program code that is executable by the processing unit 310 such that the processing unit 310 performs the steps according to various exemplary embodiments of the application described in the above processing method section of the present specification. For example, the processing unit 310 may perform the steps shown in fig. 1.
The memory unit 320 may include readable media in the form of volatile memory units, such as Random Access Memory (RAM) 3201 and/or cache memory 3202, and may further include Read Only Memory (ROM) 3203.
The storage unit 320 may also include a program/utility 3204 having a set (at least one) of program modules 3205, such program modules 3205 including, but not limited to: operating devices, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment.
Bus 330 may be one or more of several types of bus structures including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 300 may also communicate with one or more external devices 400 (e.g., keyboard, pointing device, bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 300, and/or any device (e.g., router, modem, etc.) that enables the electronic device 300 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 350. Also, electronic device 300 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet, through network adapter 360. The network adapter 360 may communicate with other modules of the electronic device 300 via the bus 330. It should be appreciated that although not shown in fig. 3, other hardware and/or software modules may be used in connection with electronic device 300, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID devices, tape drives, data backup storage devices, and the like.
From the above description of embodiments, those skilled in the art will readily appreciate that the exemplary embodiments described herein may be implemented in software, or may be implemented in software in combination with necessary hardware. Thus, the technical solution according to the embodiments of the present application may be embodied in the form of a software product, which may be stored in a computer readable storage medium (may be a CD-ROM, a usb disk, a mobile hard disk, etc.) or on a network, and includes several instructions to cause a computing device (may be a personal computer, a server, or a network device, etc.) to perform the above-mentioned method according to the present application. The computer program, when executed by a data processing device, enables the computer readable medium to carry out the above-described method of the present application, namely: such as the method shown in fig. 1.
Referring to fig. 4, a schematic diagram of a computer readable medium according to an embodiment of the present disclosure is provided.
A computer program implementing the method shown in fig. 1 may be stored on one or more computer readable media. The computer readable medium may be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but is not limited to, an apparatus, device, or means for electronic, magnetic, optical, electromagnetic, infrared, or semiconductor, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium would include the following: an electrical connection having one or more wires, a portable disk, a hard disk, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The computer readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, with readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A readable storage medium may also be any readable medium that can communicate, propagate, or transport a program for use by or in connection with an instruction execution apparatus, device, or apparatus. Program code embodied on a readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., connected via the Internet using an Internet service provider).
In summary, the application may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that some or all of the functionality of some or all of the components in accordance with embodiments of the present application may be implemented in practice using a general purpose data processing device such as a microprocessor or Digital Signal Processor (DSP). The present application can also be implemented as an apparatus or device program (e.g., a computer program and a computer program product) for performing a portion or all of the methods described herein. Such a program embodying the present application may be stored on a computer readable medium, or may have the form of one or more signals. Such signals may be downloaded from an internet website, provided on a carrier signal, or provided in any other form.
The above-described specific embodiments further describe the objects, technical solutions and advantageous effects of the present application in detail, and it should be understood that the present application is not inherently related to any particular computer, virtual device or electronic apparatus, and various general-purpose devices may also implement the present application. The foregoing description of the embodiments of the application is not intended to be limiting, but rather is intended to cover all modifications, equivalents, alternatives, and improvements that fall within the spirit and scope of the application.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments.
The foregoing is merely exemplary of the present application and is not intended to limit the present application. Various modifications and variations of the present application will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. which come within the spirit and principles of the application are to be included in the scope of the claims of the present application.
Claims (6)
1. An image resource compression method, comprising:
installing a node running environment and installing npm management tools;
acquiring instruction information;
calling a corresponding tool package to execute a script task according to the instruction information through the npm management tool, detecting a resource file, entering an interactive option to judge whether to perform deep scanning on a first folder when the resource file is detected to be the first folder, and intelligently identifying all files in the first folder when the first folder needs to be subjected to deep scanning; when all the files in the first folder are second folders, intelligently identifying all the files in the second folders until all the image resource files are identified;
converting the image resource file into an image resource file with a preset data format, wherein the image resource file is used for realizing different format requirements of the terminal; wherein, the preset data format includes: a plurality of 16-ary data formats, 64-ary data formats, and buffer data formats;
freely setting and compressing the image resource file in the preset data format according to an image compression algorithm and compression parameters, generating a new compressed image resource file according to an instruction path in the instruction information, and storing the new compressed image resource file to a designated position; wherein the compression parameters include a specified target resource, a compression ratio, and an output path.
2. The method for compressing image resources according to claim 1, wherein said calling a corresponding tool pack to execute script tasks according to said instruction information comprises:
calling a corresponding package management tool according to the instruction information;
the package management tool executes the script task according to the instruction information.
3. The method of image resource compression of claim 1, wherein the entering an interactive option to determine whether to perform a depth scan on the first folder comprises:
and when the first folder does not need to be scanned, the identified first folder is the image resource file.
4. An image resource compression apparatus, comprising:
installing a node running environment and installing npm management tools;
the instruction acquisition module acquires instruction information;
the tool pack calling module is used for calling a corresponding tool pack to execute a script task according to the instruction information through the npm management tool, detecting a resource file, entering an interactive option to judge whether the first folder is subjected to deep scanning when the resource file is detected to be the first folder, and intelligently identifying all files in the first folder when the first folder is required to be subjected to the deep scanning;
when all the files in the first folder are second folders, intelligently identifying all the files in the second folders until all the image resource files are identified;
the resource file conversion module is used for converting the image resource file into an image resource file with a preset data format and is used for realizing different format requirements of the terminal; wherein, the preset data format includes: a plurality of 16-ary data formats, 64-ary data formats, and buffer data formats;
the resource file compression module is used for freely setting and compressing the image resource file in the preset data format according to an image compression algorithm and compression parameters, generating a new compressed image resource file according to an instruction path in the instruction information, and storing the new compressed image resource file to a designated position; wherein the compression parameters include a specified target resource, a compression ratio, and an output path.
5. An electronic device, wherein the electronic device comprises:
a processor and a memory storing computer executable instructions that, when executed, cause the processor to perform the method of any of claims 1-3.
6. A computer readable storage medium, wherein the computer readable storage medium stores one or more programs which, when executed by a processor, implement the method of any of claims 1-3.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110110012.XA CN112954011B (en) | 2021-01-27 | 2021-01-27 | Image resource compression method and device and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110110012.XA CN112954011B (en) | 2021-01-27 | 2021-01-27 | Image resource compression method and device and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112954011A CN112954011A (en) | 2021-06-11 |
CN112954011B true CN112954011B (en) | 2023-11-10 |
Family
ID=76237665
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110110012.XA Active CN112954011B (en) | 2021-01-27 | 2021-01-27 | Image resource compression method and device and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112954011B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113434139A (en) * | 2021-06-23 | 2021-09-24 | 平安普惠企业管理有限公司 | Image packaging processing method and device, server and storage medium |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101989355A (en) * | 2009-07-31 | 2011-03-23 | 北京邮电大学 | Detection method for secondary compression of JPEG image |
CN103744911A (en) * | 2013-12-26 | 2014-04-23 | 乐视网信息技术(北京)股份有限公司 | Video file scanning method and electronic device |
CN106227751A (en) * | 2016-07-14 | 2016-12-14 | 青岛海信电器股份有限公司 | A kind of scan method storing file and scanning device |
CN109903350A (en) * | 2017-12-07 | 2019-06-18 | 上海寒武纪信息科技有限公司 | Method for compressing image and relevant apparatus |
CN109947722A (en) * | 2019-02-13 | 2019-06-28 | 北京达佳互联信息技术有限公司 | Data compression method, device and computer readable storage medium for application program |
CN110232050A (en) * | 2019-04-24 | 2019-09-13 | 深圳点猫科技有限公司 | The method and electronic equipment that a kind of language based on programming compresses file |
CN110544281A (en) * | 2019-08-19 | 2019-12-06 | 南斗六星系统集成有限公司 | picture batch compression method, medium, mobile terminal and device |
CN110825700A (en) * | 2019-11-07 | 2020-02-21 | 成都品果科技有限公司 | Method for efficiently scanning files in magnetic disk |
CN111354050A (en) * | 2020-02-25 | 2020-06-30 | 安徽以萨数据技术有限公司 | Android-based picture compression method and device and storage medium |
CN112181221A (en) * | 2020-09-25 | 2021-01-05 | Oppo广东移动通信有限公司 | Image processing method and device, computer readable medium and electronic device |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
AUPR192800A0 (en) * | 2000-12-06 | 2001-01-04 | Canon Kabushiki Kaisha | Digital image compression and decompression |
JP4600119B2 (en) * | 2005-03-29 | 2010-12-15 | 日本電気株式会社 | Image data compression apparatus and method, and program |
-
2021
- 2021-01-27 CN CN202110110012.XA patent/CN112954011B/en active Active
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101989355A (en) * | 2009-07-31 | 2011-03-23 | 北京邮电大学 | Detection method for secondary compression of JPEG image |
CN103744911A (en) * | 2013-12-26 | 2014-04-23 | 乐视网信息技术(北京)股份有限公司 | Video file scanning method and electronic device |
CN106227751A (en) * | 2016-07-14 | 2016-12-14 | 青岛海信电器股份有限公司 | A kind of scan method storing file and scanning device |
CN109903350A (en) * | 2017-12-07 | 2019-06-18 | 上海寒武纪信息科技有限公司 | Method for compressing image and relevant apparatus |
CN109947722A (en) * | 2019-02-13 | 2019-06-28 | 北京达佳互联信息技术有限公司 | Data compression method, device and computer readable storage medium for application program |
CN110232050A (en) * | 2019-04-24 | 2019-09-13 | 深圳点猫科技有限公司 | The method and electronic equipment that a kind of language based on programming compresses file |
CN110544281A (en) * | 2019-08-19 | 2019-12-06 | 南斗六星系统集成有限公司 | picture batch compression method, medium, mobile terminal and device |
CN110825700A (en) * | 2019-11-07 | 2020-02-21 | 成都品果科技有限公司 | Method for efficiently scanning files in magnetic disk |
CN111354050A (en) * | 2020-02-25 | 2020-06-30 | 安徽以萨数据技术有限公司 | Android-based picture compression method and device and storage medium |
CN112181221A (en) * | 2020-09-25 | 2021-01-05 | Oppo广东移动通信有限公司 | Image processing method and device, computer readable medium and electronic device |
Non-Patent Citations (1)
Title |
---|
基于HLS和压缩域运动检测的监控系统设计;郑腾飞等;工业控制计算机;第29卷(第1期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN112954011A (en) | 2021-06-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112615758B (en) | Application identification method, device, equipment and storage medium | |
CN111427569A (en) | Installation-free program adapting method and device, electronic equipment and storage medium | |
CN112954011B (en) | Image resource compression method and device and electronic equipment | |
CN111209001A (en) | Method, system, equipment and medium for batch generation of APKs of android channels | |
CN113961196A (en) | Method, device and equipment for automatically generating codes and readable storage medium | |
CN110928548A (en) | Data processing method and equipment | |
CN113760306A (en) | Method and device for installing software, electronic equipment and storage medium | |
CN110221840B (en) | Function implementation method and device of application program, equipment and storage medium | |
CN114124695A (en) | Data acquisition method and device and electronic equipment | |
CN111147530B (en) | System, switching method, intelligent terminal and storage medium of multi-voice platform | |
CN113626035B (en) | Neural network compiling method facing RISC-V equipment based on TVM | |
CN113141613B (en) | Communication channel detection method and device and electronic equipment | |
CN113141407B (en) | Page resource loading method and device and electronic equipment | |
CN112929675B (en) | Image resource compression method and device and electronic equipment | |
CN114327498A (en) | Automated deployment method, system, electronic device and computer readable medium | |
CN111124423B (en) | Compiling detection method, device, server and medium based on multiple platforms | |
CN109509467B (en) | Code generation method and device | |
CN112925840A (en) | Data export method, system, device and storage medium | |
CN112783510A (en) | Data calling method and device, electronic equipment and storage medium | |
CN113986388B (en) | Program set loading method, system, electronic device and storage medium | |
CN112311931B (en) | Method and device for processing contact information at terminal and electronic equipment | |
CN109857396B (en) | Component construction method and device, storage medium and electronic equipment | |
CN110297639B (en) | Method and apparatus for detecting code | |
CN112015379A (en) | Improved generation SDK access system | |
CN112015380A (en) | SDK access method under multiple scenes |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |