CN112929675B - 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
CN112929675B
CN112929675B CN202110110031.2A CN202110110031A CN112929675B CN 112929675 B CN112929675 B CN 112929675B CN 202110110031 A CN202110110031 A CN 202110110031A CN 112929675 B CN112929675 B CN 112929675B
Authority
CN
China
Prior art keywords
image
script
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.)
Active
Application number
CN202110110031.2A
Other languages
Chinese (zh)
Other versions
CN112929675A (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

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Data Mining & Analysis (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Information Transfer Between Computers (AREA)
  • Stored Programmes (AREA)

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 sentences of different environments can be compatible, the script resource library is adapted to various systems, an image processing script is arranged in the script resource library, a first command input by a user in a command prompt window is received, functions in the system are utilized, unnecessary configuration required by a client program is not required to be installed, and therefore, occupied storage and operation 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, and the task converter responds to the execution of the image processing script to call instructions in the second environment to execute an image compression task: and (3) performing file scanning to perform image recognition, and acquiring and compressing the recognized image. Since the image self-compression is recognized in an auto-scanning manner. Manual operation is reduced, the manual treatment process is simplified, and the treatment efficiency is improved.

Description

Image resource compression method and device and electronic equipment
Technical Field
The present disclosure 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, so that larger space and computer running memory are occupied; when the picture resources are compressed, a plurality of steps of operations are needed to be performed manually, the process is complicated, the efficiency is low, and an efficient method is needed to be provided and is suitable for various operating systems.
Disclosure of Invention
The embodiment of the specification provides a compression method, a compression device and electronic equipment for image resources, which are used for reducing the space occupied by operation and improving the processing efficiency.
The embodiment of the specification provides a compression method of image resources, which comprises the following steps:
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 is provided with 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 is used for responding to the execution of the image processing script to call the instruction in the second environment to execute the image compression task: and (3) performing file scanning to perform image recognition, and acquiring and compressing the recognized image.
Optionally, the configuring, in the terminal, a script resource library adapted to the first environment includes:
the script resource library is configured by configuring an environment variable in the first environment.
Optionally, the receiving a first command input by a user in a command prompt window, invoking an image processing script in the script resource library by executing the first command, including:
the first environment receives a first command input 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 document scanning for image recognition includes: and scanning the file in the space of the target address to perform image recognition.
Optionally, the determining the target address information generated by the user operation includes:
and receiving behavior data generated by the drag operation of the user, and acquiring target address information carried in the behavior data.
Optionally, the target address information is folder address information.
Optionally, the method further comprises:
after compressing the identified image, a compressed file is generated and output.
Optionally, the performing document scanning to perform image recognition, acquiring and compressing the recognized image includes:
an absolute path of the image is identified, and the identified image is acquired and compressed in response to a confirmation operation by the user.
Optionally, the method further comprises:
setting parameters of an image processing script, wherein the parameters of the image processing script comprise: at least one of compression ratio, output path.
Optionally, the image processing script in the script repository is a static script.
The embodiment of the present disclosure also provides a compression device 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, wherein 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, invokes 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, to perform an image compression task: and (3) performing file scanning to perform image recognition, and acquiring and compressing the recognized image.
Optionally, the configuring, in the terminal, a script resource library adapted to the first environment includes:
the script resource library is configured by configuring an environment variable in the first environment.
Optionally, the receiving a first command input by a user in a command prompt window, invoking an image processing script in the script resource library by executing the first command, including:
the first environment receives a first command input 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 document scanning for image recognition includes: and scanning the file in the space of the target address to perform image recognition.
Optionally, the determining the target address information generated by the user operation includes:
and receiving behavior data generated by the drag operation of the user, and acquiring target address information carried in the behavior data.
Optionally, the target address information is folder address information.
Optionally, the method further comprises:
after compressing the identified image, a compressed file is generated and output.
Optionally, the performing document scanning to perform image recognition, acquiring and compressing the recognized image includes:
an absolute path of the image is identified, and the identified image is acquired and compressed in response to a confirmation operation by the user.
Optionally, the method further comprises:
setting parameters of an image processing script, wherein the parameters of the image processing script comprise: at least one of compression ratio, output path.
Optionally, the image processing script in the script repository is a static script.
The embodiment of the specification also provides an electronic device, wherein the electronic device comprises:
a processor; the method comprises the steps of,
a memory storing computer executable instructions that, when executed, cause the processor to perform any of the methods described above.
The present description also provides a computer-readable storage medium storing one or more programs that, when executed by a processor, implement any of the methods described above.
The various technical schemes provided in the embodiments of the present disclosure configure a script resource library adapted to a first environment and a task converter adapted to a second environment in a terminal, so that sentences of different environments can be compatible, and adapt to various systems, the script resource library has an image processing script, receives a first command input by a user in a command prompt window, uses functions in the system, and does not need to install redundant configuration required by a client program, so that occupied storage and operation space are small, and then the task converter 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 execution of the image processing script to execute an image compression task: and (3) performing file scanning to perform image recognition, and acquiring and compressing the recognized image. Since the image self-compression is recognized in an auto-scanning manner. Manual operation is reduced, the manual treatment process is simplified, and the treatment 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 embodiments of the application and together with the description serve to explain the application and do not constitute an undue limitation to the application. In the drawings:
fig. 1 is a schematic diagram of a compression method of an image resource according to an embodiment of the present disclosure;
fig. 2 is a schematic structural diagram of a compressing apparatus for image resources 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 invention 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 invention 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 invention.
In the description of specific embodiments, features, structures, characteristics, or other details described in the present invention 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 invention without one or more of the specific features, structures, characteristics, or other details.
The flow diagrams depicted in the figures are exemplary only, and do not necessarily include all of the elements 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.
Fig. 1 is a schematic diagram of a compression method of an image resource according to an embodiment of the present disclosure, where the method may include:
s101: a script resource library adapted to a first environment and a task converter adapted to a second environment are configured in a terminal, wherein the script resource library is provided with an image processing script.
There are many channels for compressing image resources through the official network, users are required to upload resources to the server for processing, download and process, so that a great deal of flow loss is wasted, the compression program is difficult and difficult due to complicated flow, and the stability and the efficiency of downloading are poor after uploading and compressing.
Based on this we propose a method of compression locally at the terminal.
The script repository may be a package manager (npm), the first environment may be a node. Js environment with 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 the instruction of the first environment, so as to implement cross-language environment cross-system.
In an embodiment of the present specification, configuring, in a terminal, a script resource library adapted to a first environment includes:
the script resource library is configured by configuring an environment variable in the first environment.
In an embodiment of the present disclosure, the method may further include:
setting parameters of an image processing script, wherein the parameters of the image processing script comprise: at least one of compression ratio, output path.
In practical application, the fixed compression ratio and the fixed output path can be configured when the script resource library is configured, and the fixed compression ratio and the fixed output path can be temporarily configured according to specific situations in the compression process, which are not described in detail herein.
In the embodiment of the present specification, the image processing script may be a single-thread asynchronous non-blocking mode script, so that each computation only monopolizes one CPU, and subsequent computation is not blocked when an input and output request is encountered, and therefore, only small memory is occupied during running.
In the embodiment of the present specification, the image processing scripts in the script repository are static scripts.
Therefore, only the corresponding script is required to be run in the terminal, the instruction at the bottom layer of the computer is called, compression can be performed, uploading of image resources is not required, and the downloading process after compression is omitted.
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 the user needs to compress the image, the user only needs to input an instruction in a command window (CMD) of the 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 under different languages by the task converter, call a corresponding bottom program and execute the program, so that the image compression can be completed.
Thus, in an embodiment of the present disclosure, the receiving a first command input by a user in a command prompt window, invoking an image processing script in the script repository by executing the first command, includes:
the first environment receives a first command input by a user in a command prompt window, and executes the first command in the first environment.
S103: the task converter is used for responding to the execution of the image processing script to call the instruction in the second environment to execute the image compression task: and (3) performing file scanning to perform image recognition, and acquiring and compressing the recognized image.
The script resource library adapted to the first environment and the task converter adapted to the second environment are configured in the terminal, so that sentences of different environments can be compatible, the script resource library is suitable for various systems, an image processing script is arranged in the script resource library, a first command input by a user in a command prompt window is received, functions in the system are utilized, unnecessary configuration required by a client program is not required to be installed, therefore, 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, and the task converter responds to the execution of the image processing script to call instructions in the second environment to execute the image compression task: and (3) performing file scanning to perform image recognition, and acquiring and compressing the recognized image. Since the image self-compression is recognized in an auto-scanning manner. Manual operation is reduced, the manual treatment process is simplified, and the treatment efficiency is improved.
In an embodiment of the present disclosure, the performing document scanning to perform image recognition, acquiring and compressing a recognized image includes:
an absolute path of the image is identified, and the identified image is acquired and compressed in response to a confirmation operation by the user.
The absolute path of the image refers to the local address of the image, and the image can be read according to the address.
In order to facilitate the compression process, the user can select the address based on the user operation, so that the user can automatically know which folder to perform image recognition under only the corresponding operation.
In this embodiment of the present specification, further includes:
determining target address information generated by user operation;
the document scanning for image recognition includes: and scanning the file in the space of the target address to perform image recognition.
In order to make the operation process more visual, a drag function can be provided for a user to select the folder of the target address in a drag mode.
In an embodiment of the present disclosure, the determining the target address information generated by the user operation includes:
and receiving behavior data generated by the drag operation of the user, and acquiring target address information carried in the behavior data.
After the dragging, the user can perform a confirmation operation through the key, and the terminal performs compression after recognizing the confirmation operation.
In this embodiment of the present disclosure, the target address information is folder address information.
In an embodiment of the present disclosure, the method may further include:
after compressing the identified image, a compressed file is generated and output.
The image resource may be compressed and converted into a 64-bit data output, or may be in another form, which is not limited herein.
In particular implementations, we can now install the node. Js environment (an embodiment of the first environment) in the terminal, call node. Js execution npm library static script call node bind and then call the underlying c/c++ execution by cmd command.
Fig. 2 is a schematic structural diagram of an image resource compressing apparatus according to an embodiment of the present disclosure, where the apparatus may include:
a script library module 201, configured with a script resource library adapted to a first environment and a task converter adapted to a second environment in a terminal, the script resource library having an image processing script therein;
the first environment execution module 202 receives a first command input by a user in a command prompt window, invokes 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 invoking instructions in a second environment in response to execution of the image processing script, to perform an image compression task: and (3) performing file scanning to perform image recognition, and acquiring and compressing the recognized image.
In an embodiment of the present specification, configuring, in a terminal, a script resource library adapted to a first environment includes:
the script resource library is configured by configuring an environment variable in the first environment.
In this embodiment of the present disclosure, the receiving a first command input by a user in a command prompt window, invoking an image processing script in the script resource library by executing the first command, includes:
the first environment receives a first command input by a user in a command prompt window, and executes the first command in the first environment.
In order to facilitate the compression process, the user can select the address based on the user operation, so that the user can automatically know which folder to perform image recognition under only the corresponding operation.
In this embodiment of the present specification, further includes:
determining target address information generated by user operation;
the document scanning for image recognition includes: and scanning the file in the space of the target address to perform image recognition.
In order to make the operation process more visual, a drag function can be provided for a user to select the folder of the target address in a drag mode.
In an embodiment of the present disclosure, the determining the target address information generated by the user operation includes:
and receiving behavior data generated by the drag operation of the user, and acquiring target address information carried in the behavior data.
In this embodiment of the present disclosure, the target address information is folder address information.
In this embodiment of the present specification, further includes:
after compressing the identified image, a compressed file is generated and output.
In an embodiment of the present disclosure, the performing document scanning to perform image recognition, acquiring and compressing a recognized image includes:
an absolute path of the image is identified, and the identified image is acquired and compressed in response to a confirmation operation by the user.
In this embodiment of the present specification, further includes:
setting parameters of an image processing script, wherein the parameters of the image processing script comprise: at least one of compression ratio, output path.
In the embodiment of the present specification, the image processing scripts in the script repository are static scripts.
The device enables sentences of different environments to be compatible by configuring a script resource library which is adapted to a first environment and a task converter which is adapted to a second environment in a terminal, the script resource library is provided with an image processing script and is adapted to various systems, a first command which is input by a user in a command prompt window is received, functions in the system are utilized, unnecessary configuration which is required by a client program is not required to be installed, therefore, occupied storage and operation 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, and the task converter responds to the execution of the image processing script to call instructions in the second environment to execute an image compression task: and (3) performing file scanning to perform image recognition, and acquiring and compressing the recognized image. Since the image self-compression is recognized in an auto-scanning manner. Manual operation is reduced, the manual treatment process is simplified, and the treatment efficiency is improved.
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 invention, which may be regarded as a specific physical implementation of the above-described embodiment of the method and apparatus according to the present invention. Details described in relation to the embodiments of the electronic device of the present invention 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 invention, reference may be made to the above-described method or apparatus embodiments.
Fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. An electronic device 300 according to this embodiment of the present invention 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 invention.
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 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 that is executable by the processing unit 310 such that the processing unit 310 performs the steps according to various exemplary embodiments of the invention 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: an operating system, 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 systems, tape drives, data backup storage systems, 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 invention 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 invention. 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 invention, namely: such as the method shown in fig. 1.
Fig. 4 is a schematic diagram of a computer readable medium according to an embodiment of the present disclosure.
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 electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, 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 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 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, 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 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 accordance with embodiments of the present invention may be implemented in practice using a general purpose data processing device such as a microprocessor or Digital Signal Processor (DSP). The present invention 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 invention 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 invention in detail, and it should be understood that the present invention is not inherently related to any particular computer, virtual device or electronic apparatus, and various general-purpose devices may also implement the present invention. The foregoing description of the embodiments of the invention 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 invention.
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 changes may be made to the present application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc. which are within the spirit and principles of the present application are intended to be included within the scope of the claims of the present application.

Claims (10)

1. A method for compressing an image resource, 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 is provided with an image processing script, and the task converter is used for responding and converting instructions of the first environment;
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 is used for responding to the execution of the image processing script to call the instructions in the second environment and executing the image compression task: performing file scanning to perform image recognition, acquiring and compressing a recognized image, namely recognizing an absolute path of the image, and acquiring and compressing the recognized image in response to a confirmation operation of a user; the absolute path of the image refers to the address of the image at the local.
2. The method of claim 1, wherein configuring, in the terminal, a script resource library adapted to the first environment, comprises:
the script resource library is configured by configuring an environment variable in the first environment.
3. The method of claim 1, wherein receiving a first command entered by a user in a command prompt window invokes an image processing script in the script repository by executing the first command, comprising:
the first environment receives a first command input by a user in a command prompt window, and executes the first command in the first environment.
4. The method as recited in claim 1, further comprising:
determining target address information generated by user operation;
the document scanning for image recognition includes: and scanning the file in the space of the target address to perform image recognition.
5. The method of claim 4, wherein determining destination address information generated by a user operation comprises:
and receiving behavior data generated by the drag operation of the user, and acquiring target address information carried in the behavior data.
6. The method of claim 5, wherein the destination address information is folder address information.
7. The method as recited in claim 1, further comprising:
after compressing the identified image, a compressed file is generated and output.
8. An image resource compression apparatus, 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, wherein the script resource library is provided with an image processing script, and the task converter is used for responding and converting instructions of the first environment;
the first environment execution module receives a first command input by a user in a command prompt window, invokes 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 the second environment in response to execution of the image processing script, to perform an image compression task: performing file scanning to perform image recognition, acquiring and compressing a recognized image, namely recognizing an absolute path of the image, and acquiring and compressing the recognized image in response to a confirmation operation of a user; the absolute path of the image refers to the address of the image at the local.
9. An electronic device, wherein the electronic device comprises:
a processor; the method comprises the steps of,
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 CN112929675A (en) 2021-06-08
CN112929675B true 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 (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10001982B1 (en) * 2016-12-16 2018-06-19 Palantir Technologies, Inc. Imposing a common build system for services from disparate sources

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7712088B2 (en) * 2004-07-08 2010-05-04 Microsoft Corporation Method and system for a batch parser
US8099455B2 (en) * 2007-08-16 2012-01-17 Sony Ericsson Mobile Communications Ab Notifying remote devices of available content
US10026041B2 (en) * 2014-07-12 2018-07-17 Microsoft Technology Licensing, Llc Interoperable machine learning platform
CN110706147B (en) * 2019-09-29 2023-08-11 阿波罗智联(北京)科技有限公司 Image processing environment determination method, device, electronic equipment and storage medium
CN110826507B (en) * 2019-11-11 2022-08-23 北京百度网讯科技有限公司 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 (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10001982B1 (en) * 2016-12-16 2018-06-19 Palantir Technologies, Inc. Imposing a common build system for services from disparate sources

Also Published As

Publication number Publication date
CN112929675A (en) 2021-06-08

Similar Documents

Publication Publication Date Title
CN109032706B (en) Intelligent contract execution method, device, equipment and storage medium
CN113010181B (en) Deployment method and device of operators in deep learning framework and electronic equipment
WO2021013243A1 (en) Method for starting mini program, device, and computer storage medium
US20130096908A1 (en) Employing native routines instead of emulated routines in an application being emulated
CN111427569A (en) Installation-free program adapting method and device, electronic equipment and storage medium
CN111698319B (en) Method, device and system for automatically popping screen when incoming call
CN111506368B (en) Method, device, equipment and storage medium for converting asynchronous call into synchronous call
WO2022062634A1 (en) Method, apparatus, device, and storage medium for integrating map service in service
CN112214250A (en) Application program assembly loading method and device
CN109408057B (en) Method, device, medium and computing equipment for automatically generating codes
CN112929675B (en) Image resource compression method and device and electronic equipment
CN111352644A (en) Applet updating method, device, server and storage medium
CN109597952B (en) Webpage information processing method, system, electronic equipment and storage medium
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
CN113141407B (en) Page resource loading method and device and electronic equipment
CN113779122B (en) Method and device for exporting data
CN114816672A (en) Virtual machine creation method and device, electronic equipment and storage medium
CN112860447B (en) Interaction method and system between different applications
CN112650502A (en) Batch processing task processing method and device, computer equipment and storage medium
CN112764729A (en) Application software development method and device, computer equipment and readable storage medium
CN113791777A (en) Picture display method and device, computer readable storage medium and electronic equipment
CN112882698A (en) Development environment generation method and device, computer storage medium and electronic device
CN112765507B (en) Page first screen rendering and resource loading method and device and electronic equipment
CN113986388B (en) Program set loading method, system, electronic device and storage medium

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