Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
First, it should be noted that the method for viewing a picture and the mobile terminal provided in the embodiments of the present invention may be executed or applied in an operating environment of the mobile terminal, where the mobile terminal includes but is not limited to a mobile portable intelligent computing device such as a smart phone, a tablet, and a notebook, and further, the mobile terminal has a photographing function, a network function, or an image processing function.
Fig. 1 shows a flow of implementing a method for viewing a picture according to an embodiment of the present invention, which is applied to a mobile terminal and is detailed as follows:
s101, creating a first field and a second field in attribute information of a first picture, wherein the first field is used for indicating whether a second picture related to the image content of the first picture exists or not, and the second field is used for recording the storage address of the second picture.
The mobile terminal triggers the operation of saving the picture under specific operating conditions, including but not limited to: the method comprises the steps of obtaining a picture through camera shooting, obtaining the picture from a network or obtaining a new picture after image processing is carried out on an original picture. When the operation of saving the picture is triggered, compared with the existing picture storing process, the embodiment of the invention adds two fields in the attribute information which needs to be generated when the picture is saved:
the first field is used for indicating whether a picture related to the image content of the currently saved picture exists, and more specifically, whether a picture related to the image content of the currently saved picture exists locally in the mobile terminal. In implementation, this field may take the form of a Boolean (BOOL) type variable, such as a Boolean-type isLink. The value of the boolean variable is only true (true) and false (false), and therefore, in a general sense, when the first field is written as "true", it indicates that the mobile terminal locally has a picture related to the image content of the currently saved picture; when the first field is written in "false", it indicates that the mobile terminal does not locally exist a picture related to the image content of the currently saved picture.
The second field described above, which is used to record the storage address of the second picture when the first field is "true". In the implementation process, the field may adopt a List < String > of an aggregate type, and when the number of pictures related to the image content of the currently saved picture is greater than 1, the field may record the storage addresses of the pictures one by one in a List form.
In the embodiment of the present invention, the image contents of the two pictures are related, which at least includes the following two cases:
the first condition is as follows: and obtaining two pictures related to the image content through image processing.
For example, if a first picture is used as an original picture and image processing is performed to obtain a second picture, the first picture is related to the content of the second picture, and therefore, after the image processing is completed, a saving operation needs to be performed on the first picture again, corresponding attribute information is refreshed, a first identifier (e.g., "true" in boolean form) is written in a first field of the first picture, and a storage address of the second picture is written in a second field of the first picture.
For another example, if the first picture is obtained by image processing the second picture, the content of the first picture is also related to the content of the second picture, and therefore, after the image processing is completed, when the first picture is saved, it is necessary to write a first identifier (e.g., "true" in boolean form) in a first field thereof and write a storage address of the second picture in a second field thereof.
The image processing operations mentioned above include, but are not limited to, scaling, cropping, deforming, toning, adding filters or stitching, etc. the image content in the picture is not substantially changed before and after the image processing process.
Case two: and obtaining two pictures related to the image content through continuous shooting operation.
For example, if five pictures are continuously taken within one second by performing a continuous shooting operation by a camera application of the mobile terminal, the image contents of the five pictures are substantially similar, and therefore, when the five pictures are saved, it is necessary to write a first identifier (e.g., "true" in boolean form) in a first field of each picture and write a storage address of a second picture in a second field of each picture.
S102, when a viewing instruction about the first picture is received, content detection is carried out on the first field of the first picture.
When the mobile terminal receives a view instruction about a picture after the picture saving is completed, before the picture is displayed, content detection is first performed on a first field in the picture attribute information to detect whether a first identifier (e.g., "true" of boolean type) or a second identifier (e.g., "false" of boolean type) is written in the first field. And if the first identifier is detected to be written in the first field in the picture attribute information, directly displaying the picture in a viewing interface of the album.
S103, if the fact that the first mark is written in the first field of the first picture is detected, displaying the first picture and displaying a link related to a storage address of the second picture in a viewing interface.
If it is detected that the first identifier is written in the first field in the picture attribute information, then in addition to displaying the picture in the viewing interface of the album, a link needs to be displayed in the viewing interface, and the address pointed to in the link is the storage address of the picture (second picture) related to the image content of the picture (first picture). In the display process, if a click instruction for the link is detected, a second picture is displayed in a viewing interface of the album, and meanwhile, the link is also displayed in the viewing interface, and at the moment, the address pointed to in the link is the storage address of the first picture.
Further, if it is detected that the first identifier is written in the first field of the picture attribute information, in addition to displaying the picture and the link in the viewing interface of the album, a thumbnail of a picture (a second picture) related to the image content of the picture (a first picture) is displayed in the viewing interface, so that the user can preview other pictures related to the currently displayed picture on the image content to simultaneously view the image content of the related pictures.
In the implementation process, the link may be packaged as a button control in the foreground, and when a click instruction about the button control is detected, the second field of the currently displayed picture is read, the storage address list is obtained, the storage addresses in the list are accessed one by one, so as to generate a thumbnail of the picture related to the image content of the picture, and the thumbnail is displayed in the viewing interface at the same time.
Further, as an embodiment of the present invention, in the running process of the mobile terminal, the attribute information of the picture also needs to be maintained and updated in real time. As shown in fig. 2, based on the corresponding embodiment of fig. 1, the method further includes:
and S104, detecting whether the second picture is deleted.
S105, if the second picture is deleted, replacing the first identifier corresponding to the first picture with a second identifier.
In the embodiment of the present invention, the storage address in the second field of the first picture may be accessed periodically or in a manual triggering manner, and if it is found that the picture cannot be read at the corresponding storage address, it indicates that the second picture corresponding to the first picture is deleted, and at this time, the first identifier in the first field of the first picture needs to be replaced by the second identifier, so as to indicate that there is no picture related to the image content of the first picture. In addition, in this case, the content in the second field of the first picture may be cleared, or a preset character may be written in each byte of the second field to indicate that the storage address of the picture is no longer stored in the second field.
The embodiment corresponding to fig. 2 may perform real-time maintenance and update on the attribute information of the picture, so as to ensure that the user can acquire accurate associated information when viewing the picture, thereby ensuring the efficiency of viewing the picture. It should be noted that, in the embodiment corresponding to fig. 2, for the case that the number of the second pictures related to the image content of the first picture is 1, when the number of the second pictures is greater than 1, if one of the second pictures is deleted, the first field corresponding to the first picture still maintains the first identifier, the storage address of the second picture is deleted in the second field corresponding to the first picture, the storage addresses of other second pictures are maintained, and only when all the second pictures are deleted, the first identifier in the first field corresponding to the first picture can be replaced with the second identifier.
The above described method of viewing pictures is further illustrated below by way of an example and the accompanying drawings:
the mobile terminal stores a picture A in advance, a user cuts the picture A by using third-party image processing software in the mobile terminal to obtain a picture B, and adds a filter to the picture A to obtain a picture C, after the operation is completed, the storage position of the picture A is …/camera/A.png, the storage position of the picture B is …/picture beautification/B.jpg, and the storage position of the picture C is …/picture beautification/C.jpg, at this time, the following writing operation needs to be performed on the attribute fields of the pictures A, B and C:
for picture a, its isLink value (i.e., the first field) is set to true, and two memory addresses are added in its List < String > (i.e., the second field): "…/Picture beautification/B.jpg" (storage address of Picture B) and "…/Picture beautification/C.jpg" (storage address of Picture C);
for picture B, its isLink value (i.e., the first field) is set to true, and a storage address is added to its List < String > (i.e., the second field): "…/camera/a. png" (storage address of picture a);
for picture C: sets its isLink value (i.e., the first field) to true, and adds a memory address in its List < String > (i.e., the second field): "…/Camera/A. png" (storage address of Picture A).
When the user needs to view the picture A in the album, the isLink value of the picture A is read to be true in the background, and the picture A is displayed in the viewing interface, as shown in FIG. 3, besides the picture A, a thumbnail 31 and a button 32 of the picture B, and a thumbnail 33 and a button 34 of the picture C are also displayed on the viewing interface. In this display state, if the user clicks the button 33, the thumbnail of picture B is displayed in an enlarged scale as shown in fig. 4, and the thumbnail 41 and the button 42 of picture a, and the thumbnail 43 and the button 44 of picture C are displayed on the viewing interface.
The above example is only a specific implementation example of the embodiment of the present invention, and is not used to limit implementation of the solution of the embodiment of the present invention.
It can be seen from the above description of the scheme and the example that, the method for viewing pictures provided by the embodiment of the invention can simultaneously embody the relevant conditions of other pictures related to the image content of the picture in the display process of the picture, is helpful for a user to more efficiently view other pictures related to the currently displayed picture, provides a more convenient picture access mode for the pictures, and improves the operation efficiency when the pictures are viewed.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
In addition, in this embodiment, the first picture and the second picture refer to a certain picture, the first field and the second field refer to a certain field, and the "first and second" are only used for convenience of expression and reference herein to distinguish different terminals, and do not mean that there is a first picture, a second picture, or a first field and a second field corresponding thereto in a specific implementation manner of the present invention.
Fig. 5 shows a block diagram of a mobile terminal according to an embodiment of the present invention, which corresponds to the method for viewing pictures described in the above embodiment, and for convenience of explanation, only the parts related to the embodiment are shown.
Referring to fig. 5, the mobile terminal includes:
a creating unit 51 that creates, in attribute information of a first picture, a first field for indicating whether or not a second picture related to image content of the first picture exists, and a second field for recording a storage address of the second picture;
a first detecting unit 52, configured to, when receiving a viewing instruction about the first picture, perform content detection on the first field of the first picture;
and if it is detected that the first identifier is written in the first field of the first picture, the display unit 53 displays the first picture and displays a link related to a storage address of the second picture in a viewing interface.
On the basis of fig. 5, optionally, the display unit 53 further includes:
displaying a thumbnail of the second picture in the viewing interface.
Optionally, if the first identifier is written in the first field of the first picture, the mobile terminal further includes:
the image processing unit is used for carrying out image processing on the first picture to obtain the second picture;
or, the image processing device is configured to perform image processing on the second picture to obtain the first picture.
Optionally, if the first identifier is written in the first field of the first picture, the mobile terminal further includes:
and the continuous shooting unit is used for obtaining a plurality of pictures including the first picture and the second picture through continuous shooting operation.
Optionally, the mobile terminal further includes:
a second detection unit that detects whether the second picture is deleted;
and the replacing unit is used for replacing the first identifier corresponding to the first picture with a second identifier if the second picture is deleted.
The above mobile terminal can implement each process implemented by the mobile terminal in the method embodiments of fig. 1 to fig. 4, and details are not repeated here to avoid repetition.
Referring to fig. 6, a block diagram of a mobile terminal according to another embodiment of the present invention is shown. The mobile terminal 600 shown in fig. 6 includes: at least one processor 601, memory 602, at least one network interface 604, and other user interfaces 603. The various components in the mobile terminal 600 are coupled together by a bus system 605. It is understood that the bus system 605 is used to enable communications among the components. The bus system 605 includes a power bus, a control bus, and a status signal bus in addition to a data bus. For clarity of illustration, however, the various buses are labeled as bus system 605 in fig. 6.
The user interface 603 may include, among other things, a display, a keyboard, or a pointing device (e.g., a mouse, trackball, touch pad, or touch screen, among others.
It will be appreciated that the memory 602 in embodiments of the invention may be either volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. The non-volatile Memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable PROM (EEPROM), or a flash Memory. Volatile Memory can be Random Access Memory (RAM), which acts as external cache Memory. By way of example, but not limitation, many forms of RAM are available, such as Static random access memory (Static RAM, SRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic random access memory (Synchronous DRAM, SDRAM), Double Data rate Synchronous Dynamic random access memory (ddr SDRAM ), Enhanced Synchronous SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), and direct memory bus RAM (DRRAM). The memory 602 of the systems and methods described herein is intended to comprise, without being limited to, these and any other suitable types of memory.
In some embodiments, memory 602 stores the following elements, executable modules or data structures, or a subset thereof, or an expanded set thereof: an operating system 6021 and application programs 6022.
The operating system 6021 includes various system programs, such as a framework layer, a core library layer, a driver layer, and the like, and is used for implementing various basic services and processing hardware-based tasks. The application program 6022 includes various application programs such as a Media Player (Media Player), a Browser (Browser), and the like, and is used to implement various application services. A program implementing the method of an embodiment of the invention can be included in the application program 6022.
In this embodiment of the present invention, by calling a program or an instruction stored in the memory 602, specifically, a program or an instruction stored in the application 6022, the processor 701 is configured to create a first field and a second field in the attribute information of the first picture, where the first field is used to indicate whether a second picture related to the image content of the first picture exists, and the second field is used to record a storage address of the second picture; when a viewing instruction about the first picture is received, performing content detection on the first field of the first picture; and if the first identification is detected to be written in the first field of the first picture, displaying the first picture and displaying a link related to the storage address of the second picture in a viewing interface.
The method disclosed by the above-mentioned embodiment of the present invention can be applied to the processor 601, or implemented by the processor 601. The processor 601 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 601. The Processor 601 may be a general-purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable Gate Array (FPGA) or other programmable logic device, discrete Gate or transistor logic device, or discrete hardware components. The various methods, steps and logic blocks disclosed in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in the memory 602, and the processor 601 reads the information in the memory 602 and completes the steps of the method in combination with the hardware thereof.
It is to be understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or any combination thereof. For a hardware implementation, the Processing units may be implemented within one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), general purpose processors, controllers, micro-controllers, microprocessors, other electronic units configured to perform the functions described herein, or a combination thereof.
For a software implementation, the techniques described herein may be implemented with modules (e.g., procedures, functions, and so on) that perform the functions described herein. The software codes may be stored in a memory and executed by a processor. The memory may be implemented within the processor or external to the processor.
Optionally, the processor 601 is further configured to: and if the first identifier is detected to be written in the first field of the first picture, displaying the thumbnail of the second picture.
Optionally, as another embodiment, the processor 601 is further configured to: if the first identifier is written in the first field of the first picture, performing image processing on the first picture before creating the first field and the second field in the attribute information of the first picture to obtain a second picture; or, the second picture is subjected to image processing to obtain the first picture.
Optionally, as another embodiment, the processor 601 is further configured to: if the first identifier is written in the first field of the first picture, obtaining a plurality of pictures including the first picture and the second picture through continuous shooting operation before the first field and the second field are created in the attribute information of the first picture.
Optionally, as another embodiment, the processor 601 is further configured to: after the first picture is displayed in a viewing interface and a link related to a storage address of the second picture is displayed if the first identifier is written in the first field of the first picture, detecting whether the second picture is deleted; and if the second picture is deleted, replacing the first identifier corresponding to the first picture with a second identifier.
The mobile terminal 600 can implement each process implemented by the mobile terminal in the foregoing embodiments, and for avoiding repetition, details are not described here.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
While the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention as defined in the appended claims.