CN113760586A - Picture detection method and device - Google Patents

Picture detection method and device Download PDF

Info

Publication number
CN113760586A
CN113760586A CN202010857941.2A CN202010857941A CN113760586A CN 113760586 A CN113760586 A CN 113760586A CN 202010857941 A CN202010857941 A CN 202010857941A CN 113760586 A CN113760586 A CN 113760586A
Authority
CN
China
Prior art keywords
detected
pictures
storage unit
picture
file storage
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.)
Pending
Application number
CN202010857941.2A
Other languages
Chinese (zh)
Inventor
王超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun 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 Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202010857941.2A priority Critical patent/CN113760586A/en
Publication of CN113760586A publication Critical patent/CN113760586A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0706Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
    • G06F11/0727Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment in a storage system, e.g. in a DASD or network based storage system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3664Environments for testing or debugging software

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a picture detection method and device, and relates to the technical field of computers. One embodiment of the method comprises: acquiring a detection request, wherein the detection request indicates a storage path of at least one picture to be detected; determining at least one file storage unit corresponding to at least one picture to be detected respectively according to the storage path, wherein the pictures to be detected corresponding to the same content are stored in the same file storage unit; detecting whether the number and/or the resolution of the pictures to be detected stored in the file storage unit meet the requirements of the operating environment of the pictures to be detected; and when the number and/or the resolution of the pictures to be detected do not meet the requirements of the operating environment, outputting an error prompt that the pictures to be detected do not meet the requirements of the operating environment. According to the implementation method, when the fact that the number and the resolution of the pictures contained in the file storage unit of the software project do not meet the requirements of the operating environment is detected, an error prompt is output, and therefore developers can complete the software project.

Description

Picture detection method and device
Technical Field
The invention relates to the technical field of computers, in particular to a picture detection method and device.
Background
In an iOS system, developers will typically save pictures that need to be presented to users in a special folder, these pictures including: desktop icons, app launch images, page background images, various guide icons, and the like. Moreover, in order to adapt the picture to different smart device models, the iOS system specifies: a plurality of pictures satisfying a certain ratio of different resolutions need to be prepared in advance for a picture of the same content.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art:
although the iOS system makes provisions for the number and resolution of pictures, there is no corresponding detection mechanism. Therefore, if a developer forgets to prepare a picture in advance or the resolution ratio of the prepared picture does not meet the requirements of the iOS system for a certain picture to be displayed, the iOS system does not have a prompt, and further the picture is displayed abnormally on the intelligent device after the iOS engineering development is completed, which may affect the user experience.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for detecting pictures, where in a software engineering development process, by detecting the number of pictures and the resolution thereof contained in a file storage unit of a software engineering, when the number of pictures and the resolution thereof contained in the file storage unit do not meet requirements of a corresponding operating environment, it indicates that a developer may forget to prepare pictures in advance or that the resolution of the prepared pictures does not meet system requirements, and in this case, an error prompt is output, so that the developer can perfect the pictures required by the software engineering according to the error prompt, and further the developed pictures corresponding to the software engineering can be normally displayed on intelligent devices of different models, thereby improving user experience.
To achieve the above object, according to an aspect of the embodiments of the present invention, a method for detecting a picture is provided.
The picture detection method provided by the embodiment of the invention comprises the following steps:
acquiring a detection request, wherein the detection request indicates a storage path of at least one picture to be detected;
determining at least one file storage unit corresponding to at least one picture to be detected respectively according to the storage path, wherein the pictures to be detected corresponding to the same content are stored in the same file storage unit;
detecting whether the number and/or the resolution of the pictures to be detected stored in the file storage unit meet the requirements of the operating environment of the pictures to be detected;
and when the number and/or the resolution of the pictures to be detected do not meet the requirements of the operating environment, outputting an error prompt that the pictures to be detected do not meet the requirements of the operating environment.
Alternatively,
when the file storage unit comprises a data exchange file, the data exchange file has a calling relation with at least one picture to be detected in the same file storage unit;
determining whether the number and the resolution of the pictures to be detected stored in the file storage unit meet the requirements of the operating environment where the pictures to be detected are located, wherein the determining step comprises the following steps:
calling the picture to be detected in the file storage unit by using the calling relationship between the data exchange file and the picture to be detected;
and detecting whether the number of the called pictures to be detected meets the requirements of the operating environment, and if not, outputting an error prompt.
Alternatively,
and when the number of the called pictures to be detected meets the requirement of the operating environment, detecting whether the resolution of the called pictures to be detected meets the requirement of the operating environment, and if not, outputting an error prompt.
Alternatively,
and when the number of the called pictures to be detected meets the requirement of the operating environment, determining whether the pictures which are not called exist in the file storage unit, if so, outputting an error prompt which indicates that redundant files exist in the file storage unit.
Alternatively,
when the data exchange file is not included in the file storage unit, an error prompt is output with respect to the file storage unit.
Alternatively,
the method further comprises the following steps: and when the error prompt indicates that the picture to be detected is missing, generating a first picture according to the picture to be detected in the file storage unit and the requirement of the operating environment, and storing the first picture into the file storage unit.
Alternatively,
the method further comprises the following steps: and deleting the redundant pictures to be detected when the error prompt indicates that the redundant pictures to be detected exist in the file storage unit.
Alternatively,
when the error prompt indicates that the resolution of the picture to be detected in the file storage unit does not meet the requirement of the operating environment, the method further comprises the following steps:
determining a standard resolution and a resolution ratio corresponding to the operating environment;
and generating a second picture according to the standard resolution and the resolution ratio, and replacing the picture to be detected in the file storage unit with the second picture.
To achieve the above object, according to still another aspect of the embodiments of the present invention, there is provided a picture detection apparatus.
The picture detection device comprises a request acquisition module, a file storage unit determination module and a detection module; wherein:
the request acquisition module is used for acquiring a detection request, and the detection request indicates a storage path of at least one picture to be detected;
the file storage unit determining module is used for determining at least one file storage unit corresponding to at least one picture to be detected respectively according to the storage path acquired by the request acquiring module, wherein the pictures to be detected corresponding to the same content are stored in the same file storage unit;
and the detection module is used for detecting whether the number and/or the resolution of the pictures to be detected stored in the file storage unit determined by the file storage unit determination module meet the requirement of the operating environment where the pictures to be detected are located, and outputting an error prompt that the pictures to be detected do not meet the requirement of the operating environment when the number and/or the resolution of the pictures to be detected do not meet the requirement of the operating environment.
Alternatively,
the detection module is used for calling the picture to be detected in the file storage unit by utilizing the calling relationship between the data exchange file and the picture to be detected when the file storage unit comprises the data exchange file; detecting whether the number of the called pictures to be detected meets the requirement of the operating environment;
if so, detecting whether the resolution of the called picture to be detected meets the requirement of the operating environment or determining whether an un-called picture exists in the file storage unit, and if not, outputting an error prompt;
if not, an error prompt is output.
To achieve the above object, according to still another aspect of the embodiments of the present invention, a picture detecting terminal is provided.
The picture detection terminal of the embodiment of the invention comprises: one or more processors; the storage device is used for storing one or more programs, and when the one or more programs are executed by one or more processors, the one or more processors implement the picture detection method of the embodiment of the invention.
To achieve the above object, according to still another aspect of embodiments of the present invention, there is provided a computer-readable storage medium.
A computer-readable storage medium of an embodiment of the present invention stores thereon a computer program, and when the computer program is executed by a processor, the computer program implements a picture detection method of an embodiment of the present invention.
One embodiment of the above invention has the following advantages or benefits: the pictures to be detected with the same content are stored in the same file storage unit, so that after the storage path of at least one picture to be detected is obtained, whether the number and the resolution of the pictures to be detected stored in the file storage unit can meet the requirement of the operating environment where the pictures to be detected are located or not can be detected, if one of the number and the resolution of the pictures to be detected does not meet the requirement of the operating environment where the pictures to be detected are located, an error prompt is output, and the error prompt indicates that the pictures to be detected do not meet the requirement of the operating environment. It can be seen from the above description that, in the software engineering development process, the number of pictures and the resolution thereof contained in the file storage unit of the software engineering are detected, and when the number of pictures and the resolution thereof contained in the file storage unit do not meet the requirements of the corresponding operating environment, it is indicated that a developer may forget to prepare pictures in advance or the resolution of the prepared pictures does not meet the system requirements, and in this case, an error prompt is output, so that the developer can perfect the pictures required by the software engineering according to the error prompt, and further the pictures corresponding to the developed software engineering can be normally displayed on intelligent devices of different models, thereby improving user experience.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
fig. 1 is a schematic diagram illustrating the main steps of a method for detecting a picture according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating the main steps of another method for detecting a picture according to an embodiment of the present invention;
FIG. 3 is a schematic diagram illustrating the main steps of another method for detecting a picture according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of the main blocks of an apparatus for detecting pictures according to an embodiment of the present invention;
FIG. 5 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 6 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server of an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
It should be noted that the embodiments of the present invention and the technical features of the embodiments may be combined with each other without conflict.
Fig. 1 is a schematic diagram illustrating major steps of a picture detection method according to an embodiment of the present invention.
As shown in fig. 1, a method for detecting a picture according to an embodiment of the present invention mainly includes the following steps:
step S101: and acquiring a detection request, wherein the detection request indicates the storage path of at least one picture to be detected.
The picture detection method provided by the embodiment of the invention can be realized by a picture detection terminal. In the software engineering development process, a developer or a tester needs to detect whether a picture prepared in the software engineering meets the requirements of the operating environment where the software is located, and when the picture meets the requirements, the prepared picture can be normally displayed on equipment with the corresponding operating environment. In the embodiment of the invention, a detection request can be triggered by a developer or a tester, and the detection request is obtained by a picture detection terminal, wherein the detection request comprises at least one storage path of a picture to be detected, so that the detection terminal can find the picture to be detected through the storage path more quickly and execute the subsequent detection steps.
For example, when a software project is developed in an iOS system, a developer usually follows xcasts from all pictures needed in the software project (e.g., a file storage unit named "assets. Therefore, when the picture is detected, the detection request can indicate the storage path of the file storage unit with the xcessets suffix in the software project, so that the detection terminal of the picture can directly find the file storage unit with the xcessets suffix according to the storage path indicated by the detection request and detect the picture to be detected included in the file storage unit without scanning other file storage units in the software project, and the detection efficiency is improved.
In the embodiment of the present invention, the detection request may not include the storage path of the to-be-detected picture, and at this time, after the detection terminal of the picture acquires the detection request, the detection terminal of the picture may traverse all files of the software project to find the file storage unit in which the to-be-detected picture is stored, and then perform the subsequent detection step. This embodiment is not particularly limited.
Step S102: and determining at least one file storage unit corresponding to at least one picture to be detected respectively according to the storage path, wherein the pictures to be detected corresponding to the same content are stored in the same file storage unit.
In the embodiment of the present invention, the file storage unit may be a storage form such as a folder or a compressed package, or may also be a storage area such as a C disk or a mobile hard disk, which is not specifically limited in this embodiment.
In the embodiment of the present invention, for the same software, because the models of devices running the software are different, in order to enable pictures included in the software to be displayed normally on devices of different models, multiple pictures of different resolutions need to be prepared for pictures of the same content to adapt to devices of different models. In order to manage pictures, developers usually store a plurality of pictures corresponding to the same content in the same file storage unit, and store pictures of different contents in different file storage units. Here, the picture of the same content means that there is no different picture other than resolution when displayed. For example, multiple pictures corresponding to the same desktop icon are pictures of the same content, multiple pictures corresponding to the same app starting picture are pictures of the same content, and multiple pictures corresponding to the same page background picture are pictures of the same content. For another example, two pictures taken by the same person at the same time, the same place and the same angle by using devices with different resolutions are processed by using a 'warm sun' filter and a 'black and white' filter respectively, so that the two pictures are different in display in terms of resolution and different filters, and still do not belong to the same picture; and the same person is shot by using equipment with different resolutions at the same time, the same place and the same angle without being processed by a filter, and the two obtained photos are not different except for the resolution when displayed, so that the two photos belong to the same picture.
For example, in the iOS system, according to the storage path, the detection terminal of the picture finds the file storage unit named "assets. xcastes", and determines that the file storage unit includes the file storage units named "image 1.image set" and "image 2.image set", respectively. The file storage unit with the name of "image 1.image set" comprises three pictures to be detected with the names of "arrow1. png", "arrow2. png" and "arrow3. png", respectively, so as to indicate that the file storage unit with the name of "image 1.image set" corresponds to the three pictures to be detected, namely "arrow1. png", "arrow2. png" and "arrow3. png", the three pictures to be detected have the same content, correspond to the same content, namely "arrow", and the difference is only that the three pictures to be detected have different resolutions. The file storage unit named as "image 2.image set" comprises two pictures to be detected, namely "magnifier 1. png" and "magnifier 2. png", so as to indicate that the file storage unit of "image 2.image set" corresponds to the two pictures to be detected, namely "magnifier 1. png" and "magnifier 2. png", and the two pictures to be detected have the same content and correspond to the same content of "magnifying glass", and the difference is only that the two pictures to be detected have different resolutions.
In the embodiment of the present invention, each file storage unit containing a plurality of pictures to be detected with the same content should further include a data exchange file, so that a code in a software project can call, through the data exchange file, at least one picture to be detected in the same file storage unit as the data exchange file. If the file storage unit where the picture to be detected is located does not include the data exchange file, the picture to be detected cannot be called in the software running process, and therefore the picture to be detected cannot be displayed normally. Therefore, before detecting the picture to be detected, it is also required to detect whether the file storage unit in which the picture to be detected is located includes the data exchange file.
The following describes a method for detecting a picture according to an embodiment of the present invention, by taking an example of detecting whether a file storage unit corresponding to a picture to be detected includes a data exchange file.
As shown in fig. 2, another method for detecting a picture according to an embodiment of the present invention mainly includes the following steps:
step S201: acquiring a detection request, wherein the detection request indicates a storage path of at least one picture to be detected;
step S202: determining at least one file storage unit corresponding to at least one picture to be detected respectively according to the storage path, wherein the pictures to be detected corresponding to the same content are stored in the same file storage unit; and executing steps S203-S205 for each file storage unit;
step S203: determining whether the file storage unit comprises a data exchange file, if not, executing step S204, and if so, executing step S205;
step S204: outputting an error prompt about the file storage unit;
step S205: and detecting the number and/or resolution of the pictures to be detected stored in the file storage unit according to the data exchange file, and outputting an error prompt that the pictures to be detected do not meet the requirements of the operating environment when the number and/or resolution are detected not to meet the requirements of the operating environment.
For example, in the iOS system, it is specified that a file storage unit in which the picture to be detected is located should include a data exchange file contents. Therefore, when the detection terminal of the picture acquires the detection request and determines that the file storage unit corresponding to the picture to be detected is "a sses. If not, the detection of the picture to be detected can be stopped, and an error prompt about the file storage unit "assets. Json files, if included, the number and/or resolution of the pictures to be detected stored in the file storage unit "assets. xcases ets" is detected to determine whether the requirements of the operating environment are satisfied.
Step S103: and detecting whether the number and/or the resolution of the pictures to be detected stored in the file storage unit meet the requirements of the operating environment where the pictures to be detected are located.
It can be understood that when the picture to be detected meets the requirement of the operating environment, a prompt that no error is detected may be output, or a prompt that the picture to be detected is normal may be output, or the current detection process may be directly ended. This embodiment is not particularly limited.
In the embodiment of the invention, because the same system needs to correspond to various devices with different screen sizes and resolutions, in order to normally display the pictures to be detected included in the software on various different devices, the system specifies the quantity and the resolution which the software running in the system should prepare for the pictures to be detected of the same content. For example, the iOS system specifies: the pictures of the same content should include at least two pictures and the resolution ratio should be 2:3 to accommodate different iPhone models. Therefore, in the software development process, the number and resolution of the pictures to be detected stored in the file storage unit of the software project need to be detected by the picture detection terminal to determine whether the pictures to be detected meet the requirements of the operating environment.
The following describes a method for detecting pictures provided in an embodiment of the present invention, taking an example of determining whether the number and resolution of pictures to be detected stored in a file storage unit satisfy requirements of an operating environment in which the pictures to be detected are located.
As shown in fig. 3, in the method for detecting a picture according to the embodiment of the present invention, the specific implementation of step S103 may include the following steps:
step S301: calling the picture to be detected in the file storage unit by using the calling relationship between the data exchange file and the picture to be detected;
step S302: determining whether an un-called picture exists in the file storage unit, if so, executing step S303, and if not, executing step S304;
step S303: outputting an error prompt indicating that redundant files exist in the file storage unit;
step S304: determining whether the number of the called pictures to be detected meets the requirement of the running environment, if so, executing step S305, and if not, executing step S307;
step S305: determining whether the resolution of the called picture to be detected meets the requirement of the operating environment, if so, executing step S306, and if not, executing step S307;
step S306: outputting a prompt that no error is detected;
step S307: and outputting an error prompt which indicates that the picture to be detected does not meet the requirement of the operating environment.
For example, in an iOS system, to accommodate the resolution of different iPhone models, the iOS system specifies: three pictures of the same content need to be prepared, with a resolution ratio of 1:2: 3. However, since some iphones are no longer produced, and the iphones on the market at present only need two pictures with resolution ratio of 2:3, so that in a preferred embodiment of the present invention, from a practical point of view, at least two pictures to be detected with resolution ratio of 2:1 and 3:1 respectively defined by a developer can be prepared for the same content.
For example, when software runs in an iOS system, after a picture detection terminal determines that a file storage unit corresponding to a picture to be detected is 'assets.xcastes', a data exchange file is firstly analyzed, and the picture to be detected in the file storage unit is called by using a calling relation between the data exchange file and the picture to be detected so as to determine whether an un-called picture exists in the file storage unit, if so, an error prompt about the existence of redundant files in the file storage unit is output so as to prevent the existence of the redundant files, and further reduce a memory occupied by the software; if no redundant files exist, the picture detection terminal further determines the number of the called pictures to be detected, if only one picture exists, the number does not meet the requirements of the operating environment, an error prompt that the pictures to be detected do not meet the requirements of the operating environment is output, and detection is stopped or other file storage units are detected; if the number of the called pictures to be detected is not less than two, the number of the called pictures to be detected meets the requirement of the operating environment, the detection terminal of the pictures further determines the resolution of the called pictures to be detected, if the pictures to be detected comprise two pictures to be detected with the resolution ratios of 2:1 and 3:1 respectively defined by developers, the resolution meets the requirement of the operating environment, and a prompt that no error is detected is output; if the pictures to be detected with the resolution ratio of 2:1 or 3:1 defined by the developer does not exist in the pictures to be detected, the fact that the resolution does not meet the requirements of the operating environment is indicated, and error prompts about that the pictures to be detected do not meet the requirements of the operating environment are output.
Step S104: and when the number and/or the resolution of the pictures to be detected do not meet the requirements of the operating environment, outputting an error prompt that the pictures to be detected do not meet the requirements of the operating environment.
In the embodiment of the invention, in the process of detecting the picture to be detected in the software engineering, a detection log can be generated, and the detection log can be used for recording the path of the file storage unit, the name, the number and the resolution of the picture to be detected. If the number and the resolution of the pictures to be detected in one file storage unit both meet the requirements of the operating environment, recording the pictures to be detected to be normal in the detection log, and continuously detecting the pictures to be detected in the next file storage unit; if one or all of the number or the resolution of the picture to be detected in one file storage unit does not meet the requirement of the operating environment, recording the abnormality of the picture to be detected in the detection log, and outputting an error prompt according to the detection log to indicate that the picture to be detected in the file storage unit does not meet the requirement of the operating environment.
In the embodiment of the present invention, the detection log may also be used to record information of the data exchange file. If the data exchange text does not exist in one file storage unit, recording the data exchange text in the file storage unit in the detection log to be abnormal, and outputting an error prompt according to the detection log to indicate that the file storage unit has errors. If the picture to be detected which is not called by the data exchange text exists in one file storage unit, recording redundant pictures to be detected in the file storage unit in the detection log, and outputting an error prompt according to the detection log to indicate that redundant files exist in the file storage unit.
In the embodiment of the invention, after the error prompt is output by the picture detection terminal, the error indicated in the error prompt can be further repaired.
In the embodiment of the present invention, when the error prompt indicates that the picture to be detected is missing, a first picture may be generated according to the picture to be detected in the file storage unit and the requirement of the operating environment, and then the first picture is stored in the corresponding file storage unit, and the information of the first picture is added to the data exchange file, so that the data exchange file can call the first picture.
In the embodiment of the invention, when the error prompt indicates that redundant pictures to be detected exist in the file storage unit, the redundant pictures to be detected can be deleted.
In the embodiment of the invention, when the error prompt indicates that the data exchange file is absent in the file storage unit, the data exchange file can be generated according to the picture to be detected in the file storage unit, and the data exchange file is stored in the corresponding file storage unit.
In addition, in the embodiment of the present invention, when the error prompt indicates that the resolution of the to-be-detected picture in the file storage unit does not meet the requirement of the operating environment, the to-be-detected picture that does not meet the requirement may be deleted, then the standard resolution and the resolution ratio corresponding to the operating environment are determined, a second picture is generated according to the standard resolution and the resolution ratio, the second picture is stored in the corresponding file storage unit to replace the to-be-detected picture in the file storage unit, and finally, the content in the data exchange file is updated, so that the data exchange file deletes the information of the to-be-detected picture that does not meet the requirement and adds the information of the second picture, so that the data exchange file can call the second picture. The standard resolution is the resolution defined by a developer according to the operating environment, and the resolution ratio is the ratio of the picture to be detected to the standard resolution specified by the operating environment.
According to the picture detection method provided by the embodiment of the invention, the pictures to be detected with the same content are stored in the same file storage unit, so that after the storage path of at least one picture to be detected is obtained, whether the number and the resolution of the stored pictures to be detected in the file storage unit can meet the requirement of the operating environment of the pictures to be detected or not can be detected, if one of the number and the resolution of the pictures to be detected does not meet the requirement of the operating environment of the pictures to be detected, an error prompt is output, and the error prompt indicates that the pictures to be detected do not meet the requirement of the operating environment. It can be seen from the above description that in the software engineering development process, through detecting the number and resolution of the pictures included in the software engineering, when a developer forgets to prepare the pictures in advance or the prepared picture resolution does not meet the requirements of the system, an error prompt can be generated and displayed, so that the developer can perfect the software engineering according to the error prompt, and further the pictures can be normally displayed on intelligent devices of different models, and the user experience is improved.
Fig. 4 is a schematic diagram of main blocks of an apparatus for detecting pictures according to an embodiment of the present invention.
As shown in fig. 4, an apparatus 400 for detecting a picture according to an embodiment of the present invention includes a request acquisition module 401, a file storage unit determination module 402, and a detection module 403; wherein:
a request obtaining module 401, configured to obtain a detection request, where the detection request indicates a storage path of at least one picture to be detected;
a file storage unit determining module 402, configured to determine, according to the storage path obtained by the request obtaining module 401, at least one file storage unit corresponding to at least one to-be-detected picture, where the to-be-detected pictures corresponding to the same content are stored in the same file storage unit;
a detecting module 403, configured to detect whether the number and/or resolution of the to-be-detected pictures stored in the file storage unit determined by the file storage unit determining module 402 meet the requirement of the operating environment where the to-be-detected pictures are located; and when the number and/or the resolution of the pictures to be detected do not meet the requirements of the operating environment, outputting error prompts about the pictures to be detected which do not meet the requirements of the operating environment.
In the embodiment of the invention, when the file storage unit comprises the data exchange file, the data exchange file has a calling relationship with at least one picture to be detected in the same file storage unit; the detection module 403 is then configured to: calling the picture to be detected in the file storage unit by using the calling relationship between the data exchange file and the picture to be detected; and detecting whether the number of the called pictures to be detected meets the requirement of the operating environment, and if not, outputting an error prompt.
In this embodiment of the present invention, the detecting module 403 is configured to: when the number of the called pictures to be detected meets the requirement of the operating environment, whether the resolution of the called pictures to be detected meets the requirement of the operating environment is detected, and if not, the output module 404 outputs an error prompt.
In this embodiment of the present invention, the detecting module 403 is configured to: and when the number of the called pictures to be detected meets the requirement of the operating environment, determining whether the pictures which are not called exist in the file storage unit, if so, outputting an error prompt, and the error prompt indicates that redundant files exist in the file storage unit.
In this embodiment of the present invention, the detecting module 403 is configured to: when the data exchange file is not included in the file storage unit, an error prompt is output with respect to the file storage unit.
In this embodiment of the present invention, the apparatus further includes an image processing module 404, configured to: and when the error prompt indicates that the picture to be detected is missing, generating a first picture according to the picture to be detected in the file storage unit and the requirement of the operating environment, and storing the first picture into the file storage unit.
In this embodiment of the present invention, the picture processing module 404 is further configured to: and deleting the redundant pictures to be detected when the error prompt indicates that the redundant pictures to be detected exist in the file storage unit.
In this embodiment of the present invention, the picture processing module 404 is further configured to: when the error prompt indicates that the resolution of the picture to be detected in the file storage unit does not meet the requirement of the operating environment, determining the standard resolution and the resolution ratio corresponding to the operating environment; and generating a second picture according to the standard resolution and the resolution ratio, and replacing the picture to be detected in the file storage unit with the second picture.
According to the picture detection device provided by the embodiment of the invention, since the pictures to be detected with the same content are stored in the same file storage unit, after the storage path of at least one picture to be detected is obtained, whether the number and the resolution of the stored pictures to be detected in the file storage unit can meet the requirement of the operating environment of the pictures to be detected or not can be detected, if one of the number and the resolution of the pictures to be detected does not meet the requirement of the operating environment of the pictures to be detected, an error prompt is output, and the error prompt indicates that the pictures to be detected do not meet the requirement of the operating environment. It can be seen from the above description that, in the software engineering development process, the number of pictures and the resolution thereof contained in the file storage unit of the software engineering are detected, and when the number of pictures and the resolution thereof contained in the file storage unit do not meet the requirements of the corresponding operating environment, it is indicated that a developer may forget to prepare pictures in advance or the resolution of the prepared pictures does not meet the system requirements, and in this case, an error prompt is output, so that the developer can perfect the pictures required by the software engineering according to the error prompt, and further the pictures corresponding to the developed software engineering can be normally displayed on intelligent devices of different models, thereby improving user experience.
Fig. 5 shows an exemplary system architecture 500 of a picture detection method or a picture detection apparatus to which an embodiment of the present invention may be applied.
As shown in fig. 5, the system architecture 500 may include terminal devices 501, 502, 503, a network 504, and a server 505. The network 504 serves to provide a medium for communication links between the terminal devices 501, 502, 503 and the server 505. Network 504 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 501, 502, 503 to interact with a server 505 over a network 504 to receive or send messages or the like. The terminal devices 501, 502, 503 may have various communication client applications installed thereon, such as a shopping application, a web browser application, a search application, an instant messaging tool, a mailbox client, social platform software, and the like.
The terminal devices 501, 502, 503 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 505 may be a server that provides various services, such as a background management server that supports shopping websites browsed by users using the terminal devices 501, 502, 503. The background management server may analyze and perform other processing on the received data such as the product information query request, and feed back a processing result (e.g., target push information and product information) to the terminal device.
It should be noted that the method for detecting a picture provided by the embodiment of the present invention is generally executed by the terminal 505, and accordingly, the device for detecting a picture is generally disposed in the terminal 505.
It should be understood that the number of terminal devices, networks, and servers in fig. 5 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 6, a block diagram of a computer system 600 suitable for use with a terminal device implementing an embodiment of the invention is shown. The terminal device shown in fig. 6 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. 6, the computer system 600 includes a Central Processing Unit (CPU)601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 601.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer 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 of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, 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. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer 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 computer readable signal medium may also be any computer readable medium that is not a computer 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 computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a request acquisition module, a file storage unit determination module, a judgment module, and an output module. The names of these modules do not in some cases constitute a limitation on the module itself, and for example, the request acquisition module may also be described as a "module that acquires a detection request".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: acquiring a detection request, wherein the detection request indicates a storage path of at least one picture to be detected; determining at least one file storage unit corresponding to at least one picture to be detected respectively according to the storage path, wherein the pictures to be detected corresponding to the same content are stored in the same file storage unit; detecting whether the number and/or the resolution of the pictures to be detected stored in the file storage unit meet the requirements of the operating environment of the pictures to be detected; and when the number and/or the resolution of the pictures to be detected do not meet the requirements of the operating environment, outputting an error prompt that the pictures to be detected do not meet the requirements of the operating environment.
According to the technical scheme of the embodiment of the invention, the pictures to be detected with the same content are stored in the same file storage unit, so that after the storage path of at least one picture to be detected is obtained, whether the number and the resolution of the stored pictures to be detected in the file storage unit can meet the requirement of the operating environment of the pictures to be detected or not can be detected, if one of the number and the resolution of the pictures to be detected does not meet the requirement of the operating environment of the pictures to be detected, an error prompt is output, and the error prompt indicates that the pictures to be detected do not meet the requirement of the operating environment. It can be seen from the above description that, in the software engineering development process, the number of pictures and the resolution thereof contained in the file storage unit of the software engineering are detected, and when the number of pictures and the resolution thereof contained in the file storage unit do not meet the requirements of the corresponding operating environment, it is indicated that a developer may forget to prepare pictures in advance or the resolution of the prepared pictures does not meet the system requirements, and in this case, an error prompt is output, so that the developer can perfect the pictures required by the software engineering according to the error prompt, and further the pictures corresponding to the developed software engineering can be normally displayed on intelligent devices of different models, thereby improving user experience.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (12)

1. A picture detection method is characterized by comprising the following steps:
acquiring a detection request, wherein the detection request indicates a storage path of at least one picture to be detected;
determining at least one file storage unit corresponding to the at least one picture to be detected respectively according to the storage path, wherein the pictures to be detected corresponding to the same content are stored in the same file storage unit;
detecting whether the number and/or the resolution of the pictures to be detected stored in the file storage unit meet the requirements of the operating environment where the pictures to be detected are located;
and when the number and/or the resolution of the pictures to be detected do not meet the requirements of the operating environment, outputting an error prompt that the pictures to be detected do not meet the requirements of the operating environment.
2. The method according to claim 1, wherein when the file storage unit includes a data exchange file, the data exchange file has a call relationship with at least one of the pictures to be detected in the same file storage unit;
the determining whether the number and the resolution of the pictures to be detected stored in the file storage unit meet the requirements of the operating environment where the pictures to be detected are located includes:
calling the picture to be detected in the file storage unit by using the calling relation between the data exchange file and the picture to be detected;
and detecting whether the number of the called pictures to be detected meets the requirements of the operating environment, and if not, outputting the error prompt.
3. The method of claim 2,
and when the number of the called pictures to be detected meets the requirement of the operating environment, detecting whether the resolution of the called pictures to be detected meets the requirement of the operating environment, and if not, outputting the error prompt.
4. The method of claim 2,
and when the number of the called pictures to be detected meets the requirement of the operating environment, determining whether the pictures which are not called exist in the file storage unit, and if so, outputting the error prompt which indicates that redundant files exist in the file storage unit.
5. The method of claim 2, comprising:
when the data exchange file is not included in the file storage unit, outputting an error prompt about the file storage unit.
6. The method of claim 1, further comprising:
and when the error prompt indicates that the picture to be detected is missing, generating a first picture according to the picture to be detected in the file storage unit and the requirement of the operating environment, and storing the first picture in the file storage unit.
7. The method of claim 1, further comprising:
and deleting redundant pictures to be detected when the error prompt indicates that redundant pictures to be detected exist in the file storage unit.
8. The method according to claim 1, wherein when the error prompt indicates that the resolution of the picture to be detected in the file storage unit does not meet the requirement of the operating environment, the method further comprises:
determining a standard resolution and a resolution ratio corresponding to the operating environment;
and generating a second picture according to the standard resolution and the resolution ratio, and replacing the picture to be detected in the file storage unit with the second picture.
9. The picture detection device is characterized by comprising a request acquisition module, a file storage unit determination module and a detection module; wherein:
the request acquisition module is used for acquiring a detection request, and the detection request indicates a storage path of at least one picture to be detected;
the file storage unit determining module is configured to determine, according to the storage path acquired by the request acquiring module, at least one file storage unit corresponding to each of the at least one to-be-detected picture, where the to-be-detected pictures corresponding to the same content are stored in the same file storage unit;
the detection module is used for detecting whether the number and/or the resolution of the pictures to be detected stored in the file storage unit determined by the file storage unit determination module meet the requirements of the operating environment where the pictures to be detected are located; and when the number and/or the resolution of the pictures to be detected do not meet the requirements of the operating environment, outputting an error prompt that the pictures to be detected do not meet the requirements of the operating environment.
10. The apparatus of claim 9,
the detection module is used for calling the picture to be detected in the file storage unit by utilizing the calling relationship between the data exchange file and the picture to be detected when the file storage unit comprises the data exchange file; detecting whether the number of the called pictures to be detected meets the requirement of the running environment;
if so, detecting whether the resolution of the called picture to be detected meets the requirement of the operating environment or determining whether an un-called picture exists in the file storage unit, and if not, outputting the error prompt;
and if not, outputting the error prompt.
11. A picture detection terminal, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-8.
12. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-8.
CN202010857941.2A 2020-08-24 2020-08-24 Picture detection method and device Pending CN113760586A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010857941.2A CN113760586A (en) 2020-08-24 2020-08-24 Picture detection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010857941.2A CN113760586A (en) 2020-08-24 2020-08-24 Picture detection method and device

Publications (1)

Publication Number Publication Date
CN113760586A true CN113760586A (en) 2021-12-07

Family

ID=78785615

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010857941.2A Pending CN113760586A (en) 2020-08-24 2020-08-24 Picture detection method and device

Country Status (1)

Country Link
CN (1) CN113760586A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090089628A1 (en) * 2007-10-01 2009-04-02 Day Mark S File system error detection and recovery framework
CN103810089A (en) * 2012-11-12 2014-05-21 Sap股份公司 Application of automatic test based on posture
WO2017000898A1 (en) * 2015-06-30 2017-01-05 上海触乐信息科技有限公司 Software icon display method and apparatus
CN110688308A (en) * 2019-09-19 2020-01-14 广州虎牙科技有限公司 Memory storage redundancy detection method and device, electronic equipment and readable storage medium
US20200097264A1 (en) * 2018-09-24 2020-03-26 Salesforce.Com, Inc. Mobile App Publishing for a Responsive Community Experience

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090089628A1 (en) * 2007-10-01 2009-04-02 Day Mark S File system error detection and recovery framework
CN103810089A (en) * 2012-11-12 2014-05-21 Sap股份公司 Application of automatic test based on posture
WO2017000898A1 (en) * 2015-06-30 2017-01-05 上海触乐信息科技有限公司 Software icon display method and apparatus
US20200097264A1 (en) * 2018-09-24 2020-03-26 Salesforce.Com, Inc. Mobile App Publishing for a Responsive Community Experience
CN110688308A (en) * 2019-09-19 2020-01-14 广州虎牙科技有限公司 Memory storage redundancy detection method and device, electronic equipment and readable storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
STEPHEN LI: "ios ipa包瘦身——删除无用图片资源", pages 1 - 4, Retrieved from the Internet <URL:https://www.cnblogs.com/lidaojian/p/7533441.html> *

Similar Documents

Publication Publication Date Title
CN110708346B (en) Information processing system and method
CN107302597B (en) Message file pushing method and device
CN112328853A (en) Document information processing method and device and electronic equipment
CN110619096B (en) Method and apparatus for synchronizing data
CN111596991A (en) Interactive operation execution method and device and electronic equipment
CN110688353A (en) File management method, device and computer readable medium
CN115470432A (en) Page rendering method and device, electronic equipment and computer readable medium
CN112183045A (en) Online document processing method and device and electronic equipment
CN109902726B (en) Resume information processing method and device
CN114417782A (en) Display method and device and electronic equipment
CN112486783B (en) Progress bar display method and device
CN110489326B (en) IDS-based HTTPAPI debugging method device, medium and equipment
CN110619101B (en) Method and apparatus for processing information
CN110780898B (en) Page data upgrading method and device and electronic equipment
CN113760586A (en) Picture detection method and device
CN110442403B (en) Method, device, electronic equipment and medium for calling functional component
CN114356788B (en) Application program detection method, device, equipment and medium based on user information
CN114297157B (en) File processing method, device, equipment and medium
CN114661397B (en) Download management method, device, electronic equipment and storage medium
CN112988528B (en) Log processing method, device and container group
CN110099122B (en) Method and apparatus for sending network request
CN113296978A (en) Content copying method, device, equipment and computer readable medium
CN113835796A (en) Method and apparatus for processing information
CN116955860A (en) Information processing method, apparatus, electronic device and storage medium
CN117648117A (en) Code branch management method, system, electronic equipment 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