CN112929675A - Image resource compression method and device and electronic equipment - Google Patents

Image resource compression method and device and electronic equipment Download PDF

Info

Publication number
CN112929675A
CN112929675A CN202110110031.2A CN202110110031A CN112929675A CN 112929675 A CN112929675 A CN 112929675A CN 202110110031 A CN202110110031 A CN 202110110031A CN 112929675 A CN112929675 A CN 112929675A
Authority
CN
China
Prior art keywords
script
image
environment
image processing
command
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110110031.2A
Other languages
Chinese (zh)
Other versions
CN112929675B (en
Inventor
欧阳志刚
丘晓强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Qiyue Information Technology Co Ltd
Original Assignee
Shanghai Qiyue Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Qiyue Information Technology Co Ltd filed Critical Shanghai Qiyue Information Technology Co Ltd
Priority to CN202110110031.2A priority Critical patent/CN112929675B/en
Publication of CN112929675A publication Critical patent/CN112929675A/en
Application granted granted Critical
Publication of CN112929675B publication Critical patent/CN112929675B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/85Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using pre-processing or post-processing specially adapted for video compression
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N1/00Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
    • H04N1/04Scanning arrangements, i.e. arrangements for the displacement of active reading or reproducing elements relative to the original or reproducing medium, or vice versa
    • YGENERAL 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
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE 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/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The embodiment of the specification provides a compression method of image resources, a script resource library adapted to a first environment and a task converter adapted to a second environment are configured in a terminal, so that statements in different environments can be compatible, the method is suitable for various systems, the script resource library is provided with an image processing script, a first command input by a user in a command prompt window is received, functions in the system are utilized, unnecessary configuration required by installing a client program is not needed, occupied storage and running space are small, then the image processing script in the script resource library is called by executing the first command, the image processing script is executed, the task converter responds to the execution of the image processing script to call an instruction in the second environment, and an image compression task is executed: and scanning the file to perform image recognition, and acquiring and compressing the recognized image. The image self-compression is identified due to the automatic scanning mode. Manual operation is reduced, the manual processing process is simplified, and the processing efficiency is improved.

Description

Image resource compression method and device and electronic equipment
Technical Field
The present application relates to the field of computers, and in particular, to a method and an apparatus for compressing image resources, and an electronic device.
Background
At present, most image resource compression tools need to install corresponding application programs under each system according to different operating systems, and occupy larger space and computer running memory; when picture resources are compressed, multi-step operation is required manually, the process is complicated, the efficiency is low, and an efficient method is needed and is suitable for various operating systems.
Disclosure of Invention
The embodiment of the specification provides a compression method and device for image resources and electronic equipment, which are used for reducing the space occupied by operation and improving the processing efficiency.
An embodiment of the present specification provides a method for compressing an image resource, including:
configuring a script resource library adapted to a first environment and a task converter adapted to a second environment in a terminal, wherein the script resource library has an image processing script;
receiving a first command input by a user in a command prompt window, calling an image processing script in the script resource library by executing the first command, and executing the image processing script;
the task converter, in response to execution of the image processing script invoking instructions in a second environment, executes an image compression task: and scanning the file to perform image recognition, and acquiring and compressing the recognized image.
Optionally, the configuring, in the terminal, a script repository adapted to the first environment includes:
the script resource library is configured by configuring environment variables in the first environment.
Optionally, the receiving a first command input by a user in a command prompt window, and invoking an image processing script in the script repository by executing the first command includes:
the first environment receives a first command entered by a user in a command prompt window and executes the first command in the first environment.
Optionally, the method further comprises:
determining target address information generated by user operation;
the scanning of the file for image recognition comprises the following steps: and scanning the file in the space of the target address to perform image recognition.
Optionally, the determining target address information generated by a user operation includes:
and receiving behavior data generated by the dragging operation of the user, and acquiring the target address information carried in the behavior data.
Optionally, the destination address information is folder address information.
Optionally, the method further comprises:
after the identified image is compressed, a compressed file is generated and output.
Optionally, the scanning the file to perform image recognition, and acquiring and compressing the recognized image includes:
an absolute path of the image is recognized, and the recognized image is acquired and compressed in response to a confirmation operation of a user.
Optionally, the method further comprises:
setting parameters of an image processing script, wherein the parameters of the image processing script comprise: compression ratio, output path.
Optionally, the image processing script in the script repository is a static script.
An embodiment of the present specification further provides a compression apparatus for image resources, including:
the script library module is used for configuring a script resource library adapted to a first environment and a task converter adapted to a second environment in the terminal, and the script resource library is provided with an image processing script;
the first environment execution module receives a first command input by a user in a command prompt window, calls an image processing script in the script resource library by executing the first command, and executes the image processing script;
a second environment execution module, the task converter invoking instructions in a second environment in response to execution of the image processing script, executing an image compression task: and scanning the file to perform image recognition, and acquiring and compressing the recognized image.
Optionally, the configuring, in the terminal, a script repository adapted to the first environment includes:
the script resource library is configured by configuring environment variables in the first environment.
Optionally, the receiving a first command input by a user in a command prompt window, and invoking an image processing script in the script repository by executing the first command includes:
the first environment receives a first command entered by a user in a command prompt window and executes the first command in the first environment.
Optionally, the method further comprises:
determining target address information generated by user operation;
the scanning of the file for image recognition comprises the following steps: and scanning the file in the space of the target address to perform image recognition.
Optionally, the determining target address information generated by a user operation includes:
and receiving behavior data generated by the dragging operation of the user, and acquiring the target address information carried in the behavior data.
Optionally, the destination address information is folder address information.
Optionally, the method further comprises:
after the identified image is compressed, a compressed file is generated and output.
Optionally, the scanning the file to perform image recognition, and acquiring and compressing the recognized image includes:
an absolute path of the image is recognized, and the recognized image is acquired and compressed in response to a confirmation operation of a user.
Optionally, the method further comprises:
setting parameters of an image processing script, wherein the parameters of the image processing script comprise: compression ratio, output path.
Optionally, the image processing script in the script repository is a static script.
An embodiment of the present specification further provides an electronic device, where the electronic device includes:
a processor; and the number of the first and second groups,
a memory storing computer-executable instructions that, when executed, cause the processor to perform any of the methods described above.
The present specification also provides a computer readable storage medium, wherein the computer readable storage medium stores one or more programs which, when executed by a processor, implement any of the above methods.
Various technical solutions provided in this specification configure a script resource library adapted to a first environment and a task converter adapted to a second environment in a terminal, so that statements in different environments can be compatible, and the script resource library is adapted to various systems, where the script resource library has an image processing script, receives a first command input by a user in a command prompt window, and utilizes functions in the system, and unnecessary configuration required by installing a client program is not required, so that occupied storage and running space is small, and then calls an image processing script in the script resource library by executing the first command, and executes the image processing script, and the task converter calls an instruction in the second environment in response to execution of the image processing script, and executes an image compression task: and scanning the file to perform image recognition, and acquiring and compressing the recognized image. The image self-compression is identified due to the automatic scanning mode. Manual operation is reduced, the manual processing process is simplified, and the processing efficiency is improved.
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 application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a schematic diagram illustrating a compression method of an image resource according to an embodiment of the present disclosure;
fig. 2 is a schematic structural diagram of an image resource compressing apparatus provided in an embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of an electronic device provided in an embodiment of the present disclosure;
fig. 4 is a schematic diagram of a computer-readable medium provided in an embodiment of the present specification.
Detailed Description
Exemplary embodiments of the present invention will now be described more fully with reference to the accompanying drawings. The exemplary embodiments, however, may 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 invention to those skilled in the art. The same reference numerals denote the same or similar elements, components, or parts in the drawings, and thus their repetitive description will be omitted.
Features, structures, characteristics or other details described in a particular embodiment do not preclude the fact that the features, structures, characteristics or other details may be combined in a suitable manner in one or more other embodiments in accordance with the technical idea of the invention.
In describing particular embodiments, the present invention has been described with reference to features, structures, characteristics or other details that are within the purview of one skilled in the art to provide a thorough understanding of the embodiments. One skilled in the relevant art will recognize, however, that the invention may be practiced without one or more of the specific features, structures, characteristics, or other details.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to 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 actual execution sequence may be changed according to the actual situation.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor means and/or microcontroller means.
The term "and/or" and/or "includes all combinations of any one or more of the associated listed items.
Fig. 1 is a schematic diagram of a compression method for an image resource according to an embodiment of the present disclosure, where the method may include:
s101: and configuring a script resource library adapted to a first environment and a task converter adapted to a second environment in the terminal, wherein the script resource library has an image processing script.
There are many channels that compress image resources through official website, need the user to upload the resource by oneself and handle the completion to the server, download the processing again, caused a large amount of flow losses extravagantly, the flow is complicated moreover makes the compression procedure add another difficulty, through uploading compression download stability again poor and inefficiency etc..
Based on this, we propose a method for compression local to the terminal.
The script repository may be a package manager (npm), the first environment may be a node.js environment with its own package manager functionality, and the second environment may be an underlying environment, such as C + +, C language, and so on.
The task converter adapted to the second environment may be nodebindings, and is configured to respond to and convert an instruction of the first environment, so as to implement a cross-language environment and a cross-system.
In an embodiment of this specification, the configuring, in the terminal, a script repository adapted to a first environment includes:
the script resource library is configured by configuring environment variables in the first environment.
In an embodiment of the present specification, the method may further include:
setting parameters of an image processing script, wherein the parameters of the image processing script comprise: compression ratio, output path.
In practical application, a fixed compression ratio and an output path may be configured when the script resource library is configured, or may be temporarily configured according to specific situations in the compression process, which is not described in detail herein.
In this embodiment, the image processing script may be a single-threaded asynchronous non-blocking mode script, so that each computation is only exclusive to one CPU due to single-threaded, and subsequent computations are not blocked when encountering input and output requests, and thus only a small memory is occupied during running.
In the embodiment of the present specification, the image processing script in the script repository is a static script.
Therefore, only the corresponding script is operated in the terminal to call the instruction of the bottom layer of the computer, so that the compression can be carried out, the image resource does not need to be uploaded, and the downloading process after the compression is also saved.
S102: and receiving a first command input by a user in a command prompt window, calling an image processing script in the script resource library by executing the first command, and executing the image processing script.
After the configuration is completed, if a user needs to compress an image, the user only needs to input an instruction in a command window (CMD) of a computer operating system, execute the instruction to call an image processing script in a script resource library, execute the image processing script to call a task converter, convert the instruction in different languages by the task converter, call a corresponding bottom layer program and execute the program, and then the image compression can be completed.
Therefore, in this embodiment of the present specification, the receiving a first command input by a user in a command prompt window, and invoking an image processing script in the script repository by executing the first command includes:
the first environment receives a first command entered by a user in a command prompt window and executes the first command in the first environment.
S103: the task converter, in response to execution of the image processing script invoking instructions in a second environment, executes an image compression task: and scanning the file to perform image recognition, and acquiring and compressing the recognized image.
Configuring a script resource library adapted to a first environment and a task converter adapted to a second environment in a terminal, so that statements in different environments can be compatible and are suitable for various systems, wherein the script resource library has an image processing script, receiving a first command input by a user in a command prompt window, utilizing functions in the system, and needing no redundant configuration required by installing a client program, so that the occupied storage and running space is small, then calling the image processing script in the script resource library by executing the first command, executing the image processing script, calling an instruction in the second environment by the task converter in response to the execution of the image processing script, and executing an image compression task: and scanning the file to perform image recognition, and acquiring and compressing the recognized image. The image self-compression is identified due to the automatic scanning mode. Manual operation is reduced, the manual processing process is simplified, and the processing efficiency is improved.
In an embodiment of this specification, the performing file scanning to perform image recognition, and acquiring and compressing the recognized image includes:
an absolute path of the image is recognized, and the recognized image is acquired and compressed in response to a confirmation operation of a user.
The absolute path of the image refers to the address of the image in the local area, and the image can be read according to the address.
In order to facilitate the compression process, a function of selecting an address based on user operation can be provided, so that the user only needs to perform corresponding operation, and the terminal can automatically know which folder the image recognition needs to be performed under.
In the embodiment of this specification, still include:
determining target address information generated by user operation;
the scanning of the file for image recognition comprises the following steps: and scanning the file in the space of the target address to perform image recognition.
In order to make the operation process more intuitive, a dragging function can be provided for a user to select a folder of a target address in a dragging mode.
In an embodiment of this specification, the determining target address information generated by a user operation includes:
and receiving behavior data generated by the dragging operation of the user, and acquiring the target address information carried in the behavior data.
After dragging, the user can perform confirmation operation through the key, and the terminal executes compression after recognizing the confirmation operation.
In an embodiment of the present specification, the target address information is folder address information.
In an embodiment of the present specification, the method may further include:
after the identified image is compressed, a compressed file is generated and output.
The image resource may be compressed and converted into 64-bit data for output, or may be in other forms, which is not limited herein.
In particular, we can now install a node.js environment (an embodiment of the first environment) in the terminal, call node bins through cmd command call node.js execution npm library static scripts to call underlying c/c + + execution.
Fig. 2 is a schematic structural diagram of an apparatus for compressing an image resource according to an embodiment of the present disclosure, where the apparatus may include:
a script library module 201, which configures a script resource library adapted to a first environment and a task converter adapted to a second environment in a terminal, wherein the script resource library has an image processing script;
the first environment execution module 202 receives a first command input by a user in a command prompt window, calls an image processing script in the script resource library by executing the first command, and executes the image processing script;
a second environment execution module 203, the task converter, in response to the execution of the image processing script invoking instructions in a second environment, executing an image compression task: and scanning the file to perform image recognition, and acquiring and compressing the recognized image.
In an embodiment of this specification, the configuring, in the terminal, a script repository adapted to a first environment includes:
the script resource library is configured by configuring environment variables in the first environment.
In this embodiment of the present specification, the receiving a first command input by a user in a command prompt window, and invoking an image processing script in the script repository by executing the first command includes:
the first environment receives a first command entered by a user in a command prompt window and executes the first command in the first environment.
In order to facilitate the compression process, a function of selecting an address based on user operation can be provided, so that the user only needs to perform corresponding operation, and the terminal can automatically know which folder the image recognition needs to be performed under.
In the embodiment of this specification, still include:
determining target address information generated by user operation;
the scanning of the file for image recognition comprises the following steps: and scanning the file in the space of the target address to perform image recognition.
In order to make the operation process more intuitive, a dragging function can be provided for a user to select a folder of a target address in a dragging mode.
In an embodiment of this specification, the determining target address information generated by a user operation includes:
and receiving behavior data generated by the dragging operation of the user, and acquiring the target address information carried in the behavior data.
In an embodiment of the present specification, the target address information is folder address information.
In the embodiment of this specification, still include:
after the identified image is compressed, a compressed file is generated and output.
In an embodiment of this specification, the performing file scanning to perform image recognition, and acquiring and compressing the recognized image includes:
an absolute path of the image is recognized, and the recognized image is acquired and compressed in response to a confirmation operation of a user.
In the embodiment of this specification, still include:
setting parameters of an image processing script, wherein the parameters of the image processing script comprise: compression ratio, output path.
In the embodiment of the present specification, the image processing script in the script repository is a static script.
The device enables statements in different environments to be compatible and is suitable for various systems by configuring a script resource library adaptive to a first environment and a task converter adaptive to a second environment in a terminal, wherein the script resource library is provided with an image processing script, receives a first command input by a user in a command prompt window, utilizes functions in the system, does not need to install redundant configuration required by a client program, so that the occupied storage and running space is small, then calls the image processing script in the script resource library by executing the first command and executes the image processing script, and the task converter calls an instruction in the second environment in response to the execution of the image processing script and executes an image compression task: and scanning the file to perform image recognition, and acquiring and compressing the recognized image. The image self-compression is identified due to the automatic scanning mode. Manual operation is reduced, the manual processing process is simplified, and the processing efficiency is improved.
Based on the same inventive concept, the embodiment of the specification further provides the electronic equipment.
In the following, embodiments of the electronic device of the present invention are described, which may be regarded as specific physical implementations for the above-described embodiments of the method and apparatus of the present invention. Details described in the embodiments of the electronic device of the invention should be considered supplementary to the embodiments of the method or apparatus described above; for details which are not disclosed in embodiments of the electronic device of the invention, reference may be made to the above-described embodiments of the method or the apparatus.
Fig. 3 is a schematic structural diagram of an electronic device provided in an embodiment of the present disclosure. An electronic device 300 according to this embodiment of the invention is described below with reference to fig. 3. The electronic device 300 shown in fig. 3 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 3, electronic device 300 is embodied in the form of a general purpose computing device. The 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 various system 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 executable by the processing unit 310 to cause the processing unit 310 to perform the steps according to various exemplary embodiments of the present invention described in the above-mentioned processing method section of the present specification. For example, the processing unit 310 may perform the steps as shown in fig. 1.
The storage unit 320 may include readable media in the form of volatile storage units, such as a random access memory unit (RAM)3201 and/or a cache storage unit 3202, and may further include a read only memory unit (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: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise 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.), with one or more devices that enable a user to interact with the electronic device 300, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 300 to communicate with one or more other computing devices. Such communication may occur via an input/output (I/O) interface 350. Also, the electronic device 300 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) via the network adapter 360. Network adapter 360 may communicate with other modules of electronic device 300 via bus 330. It should be appreciated that although not shown in FIG. 3, other hardware and/or software modules may be used in conjunction with electronic device 300, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments of the present invention described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiment of the present invention can be embodied in the form of a software product, which can be stored in a computer-readable storage medium (which can be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to make a computing device (which can be a personal computer, a server, or a network device, etc.) execute the above-mentioned method according to the present invention. The computer program, when executed by a data processing apparatus, enables the computer readable medium to implement the above-described method of the invention, namely: such as the method shown in fig. 1.
Fig. 4 is a schematic diagram of a computer-readable medium provided in an embodiment of the present specification.
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. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable 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 disc 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 propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable storage medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. 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 for aspects of the present invention 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 and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, 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., through the internet using an internet service provider).
In summary, the invention 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 embodiments in accordance with the invention may be implemented in practice using a general purpose data processing device such as a microprocessor or a Digital Signal Processor (DSP). The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
While the foregoing embodiments have described the objects, aspects and advantages of the present invention in further detail, it should be understood that the present invention is not inherently related to any particular computer, virtual machine or electronic device, and various general-purpose machines may be used to implement the present invention. The invention is not to be considered as limited to the specific embodiments thereof, but is to be understood as being modified in all respects, all changes and equivalents that come within the spirit and scope of the invention.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (10)

1. A method for compressing image resources, comprising:
configuring a script resource library adapted to a first environment and a task converter adapted to a second environment in a terminal, wherein the script resource library has an image processing script;
receiving a first command input by a user in a command prompt window, calling an image processing script in the script resource library by executing the first command, and executing the image processing script;
the task converter, in response to execution of the image processing script invoking instructions in a second environment, executes an image compression task: and scanning the file to perform image recognition, and acquiring and compressing the recognized image.
2. The method according to claim 1, wherein configuring a script resource library adapted to the first environment in the terminal comprises:
the script resource library is configured by configuring environment variables in the first environment.
3. The method according to any one of claims 1-2, wherein the receiving a first command input by a user in a command prompt window, the invoking an image processing script in the script repository by executing the first command comprises:
the first environment receives a first command entered by a user in a command prompt window and executes the first command in the first environment.
4. The method according to any one of claims 1-3, further comprising:
determining target address information generated by user operation;
the scanning of the file for image recognition comprises the following steps: and scanning the file in the space of the target address to perform image recognition.
5. The method according to any one of claims 1-4, wherein the determining target address information generated by a user operation comprises:
and receiving behavior data generated by the dragging operation of the user, and acquiring the target address information carried in the behavior data.
6. The method of any of claims 1-5, wherein the destination address information is folder address information.
7. The method according to any one of claims 1-6, further comprising:
after the identified image is compressed, a compressed file is generated and output.
8. An apparatus for compressing image resources, comprising:
the script library module is used for configuring a script resource library adapted to a first environment and a task converter adapted to a second environment in the terminal, and the script resource library is provided with an image processing script;
the first environment execution module receives a first command input by a user in a command prompt window, calls an image processing script in the script resource library by executing the first command, and executes the image processing script;
a second environment execution module, the task converter invoking instructions in a second environment in response to execution of the image processing script, executing an image compression task: and scanning the file to perform image recognition, and acquiring and compressing the recognized image.
9. An electronic device, wherein the electronic device comprises:
a processor; and the number of the first and second groups,
a memory storing computer-executable instructions that, when executed, cause the processor to perform the method of any of claims 1-7.
10. 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-7.
CN202110110031.2A 2021-01-27 2021-01-27 Image resource compression method and device and electronic equipment Active CN112929675B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110110031.2A CN112929675B (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
CN202110110031.2A CN112929675B (en) 2021-01-27 2021-01-27 Image resource compression method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN112929675A true CN112929675A (en) 2021-06-08
CN112929675B CN112929675B (en) 2023-05-19

Family

ID=76166854

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110110031.2A Active CN112929675B (en) 2021-01-27 2021-01-27 Image resource compression method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN112929675B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060010123A1 (en) * 2004-07-08 2006-01-12 Microsoft Corporation Method and system for a batch parser
CN101779439A (en) * 2007-08-16 2010-07-14 索尼爱立信移动通讯有限公司 Notifying remote devices of available content
US20160012350A1 (en) * 2014-07-12 2016-01-14 Microsoft Technology Licensing, Llc Interoperable machine learning platform
US10001982B1 (en) * 2016-12-16 2018-06-19 Palantir Technologies, Inc. Imposing a common build system for services from disparate sources
CN110706147A (en) * 2019-09-29 2020-01-17 百度在线网络技术(北京)有限公司 Image processing environment determination method and device, electronic equipment and storage medium
CN110826507A (en) * 2019-11-11 2020-02-21 北京百度网讯科技有限公司 Face detection method, device, equipment and storage medium
CN111949419A (en) * 2020-07-17 2020-11-17 上海淇馥信息技术有限公司 Cross-environment resource acquisition method and device and electronic equipment

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060010123A1 (en) * 2004-07-08 2006-01-12 Microsoft Corporation Method and system for a batch parser
CN101779439A (en) * 2007-08-16 2010-07-14 索尼爱立信移动通讯有限公司 Notifying remote devices of available content
US20160012350A1 (en) * 2014-07-12 2016-01-14 Microsoft Technology Licensing, Llc Interoperable machine learning platform
US10001982B1 (en) * 2016-12-16 2018-06-19 Palantir Technologies, Inc. Imposing a common build system for services from disparate sources
CN110706147A (en) * 2019-09-29 2020-01-17 百度在线网络技术(北京)有限公司 Image processing environment determination method and device, electronic equipment and storage medium
CN110826507A (en) * 2019-11-11 2020-02-21 北京百度网讯科技有限公司 Face detection method, device, equipment and storage medium
CN111949419A (en) * 2020-07-17 2020-11-17 上海淇馥信息技术有限公司 Cross-environment resource acquisition method and device and electronic equipment

Also Published As

Publication number Publication date
CN112929675B (en) 2023-05-19

Similar Documents

Publication Publication Date Title
CN109542399B (en) Software development method and device, terminal equipment and computer readable storage medium
CN106325847B (en) Method and device for acquiring application program function based on iOS platform
US9063760B2 (en) Employing native routines instead of emulated routines in an application being emulated
CN110688096B (en) Method and device for constructing application program containing plug-in, medium and electronic equipment
CN111198996A (en) Page display method and device and electronic equipment
CN110888639A (en) Business code compiling and packaging method and device
CN113760306A (en) Method and device for installing software, electronic equipment and storage medium
CN108845864B (en) Spring frame-based JVM garbage recycling method and device
CN113821220A (en) Installation method and device of linux operating system
CN109408057B (en) Method, device, medium and computing equipment for automatically generating codes
CN111414154A (en) Method and device for front-end development, electronic equipment and storage medium
CN112954011B (en) Image resource compression method and device and electronic equipment
CN111352644A (en) Applet updating method, device, server and storage medium
CN112929675B (en) Image resource compression method and device and electronic equipment
CN113141407B (en) Page resource loading method and device and electronic equipment
CN115934076A (en) Cross-platform client micro-service providing device and method and electronic equipment
CN113779122B (en) Method and device for exporting data
CN113568623A (en) Application deployment method and device and electronic equipment
CN112650502A (en) Batch processing task processing method and device, computer equipment and storage medium
WO2022019784A1 (en) Assigning computing resources to execution of evaluators for image animation
CN112860447A (en) Interaction method and system between different applications
CN111782248B (en) Updating method and device of terminal application and electronic equipment
CN116382796B (en) Plug-in management method and device of H5 applet runner and electronic equipment
CN113986388B (en) Program set loading method, system, electronic device and storage medium
CN112765507B (en) Page first screen rendering and resource loading method and device and electronic equipment

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