Photograph display method and apparatus

By directly converting YUV format images to RGB format and sharing them with gallery applications for display before post-processing is complete, the problem of delayed photo display after electronic devices take pictures is solved, achieving the effect of quickly displaying real images.

CN119729195BActive Publication Date: 2025-11-25HONOR DEVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311214845.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-19
Publication Date
2025-11-25
Estimated Expiration
2043-09-19

AI Technical Summary

Technical Problem

There is a noticeable delay when electronic devices quickly display the latest photos after they are taken. This is because the image post-processing algorithm has not been completed, resulting in a long time-consuming process for encoding, saving images, and updating the image database.

Method used

Before image post-processing is complete, the YUV format image is directly converted to RGB format and shared with the gallery application for display, avoiding the encoding and decoding process, and directly transferring image data through memory to improve display speed.

Benefits of technology

It shortens the time from clicking the thumbnail to displaying the actual image, improving the user experience and reducing the perceived latency by 300-400 milliseconds.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119729195B_ABST
    Figure CN119729195B_ABST
Patent Text Reader

Abstract

The application provides a photo display method and device, applied to an electronic device, the method comprising: in response to the user clicking the shooting button of the shooting interface of the camera application, image shooting is performed, and a thumbnail is obtained based on the latest shot image, and further updating the thumbnail area of the shooting interface to the first thumbnail. In response to the user's click operation on the thumbnail area, the image display interface of the gallery application is displayed, and the second thumbnail is displayed in the image display interface. In the case where it is determined that the first image is not currently encoded, the first image is converted from the first format to the second format to obtain the second image, and the second image is directly shared to the gallery application for display. The scheme does not require the processing flow after the image post-processing of the first image, such as the processes of coding and decoding, updating the media information library, and reading the real image from the media information library. The time consumption of format conversion is far less than that of the above processing flow. Therefore, the scheme greatly reduces the waiting time of displaying the real image after shooting and improves the display speed of the real image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and in particular to a photograph display method and apparatus. Background Technology

[0002] With the increasing popularity of mobile phones, tablets and other electronic devices, camera applications have become one of the essential applications for electronic devices.

[0003] Due to the limited size of electronic devices, the image quality is significantly different compared to traditional cameras (such as SLR cameras). To improve image quality, electronic device manufacturers often employ complex image post-processing algorithms to enhance image sharpness and signal-to-noise ratio.

[0004] After a camera app takes a picture, it displays a thumbnail image in the shooting interface. If the user immediately taps the thumbnail to switch to the gallery app to view the newly taken photo, the image post-processing algorithm is often not yet complete. After post-processing, other processes are required, such as encoding, saving the image, updating the image database, decoding, and updating the display. Only after these processes are completed can the actual image be displayed, but this process usually takes time, resulting in a noticeable delay in the user experience.

[0005] In conclusion, how to quickly display the latest photos taken has become an urgent problem to be solved. Summary of the Invention

[0006] In view of the above, this application provides a photo display method and apparatus to solve the aforementioned problems, and the disclosed technical solution is as follows:

[0007] In a first aspect, this application provides a photo display method applied to an electronic device. The method includes: displaying a camera application's shooting interface, the shooting interface including a shooting button and a thumbnail area; taking an image in response to a click on the shooting button; displaying a first thumbnail in the thumbnail area; displaying an image display interface of a gallery application in response to a click on the thumbnail area, the image display interface displaying a second thumbnail, the second thumbnail and the first thumbnail being different sizes of the same image; if it is determined that the first image has not been encoded, converting the first image from a first format to a second format to obtain a second image, and sending the shared information of the second image to the gallery application, wherein the first image is an image obtained after performing an image post-processing algorithm on the most recently captured image, and the second image is an unencoded image; the gallery application obtains the second image based on the shared information and switches the display content of the image display interface from the second thumbnail to the second image. It can be seen that this solution directly converts the first image in the first format obtained after image post-processing into a second image in the second format. Then, the sharing information of the second image is sent to the gallery application, so that the gallery application can obtain and display the second image based on the sharing information. This process does not require encoding and decoding of the first image in the first format, thus saving the time spent on encoding and decoding and subsequent processes, thereby speeding up the display of real images.

[0008] In one possible implementation of the first aspect, if it is determined that the first image has not been encoded, converting the first image from a first format to a second format to obtain a second image includes: in response to a click operation on a thumbnail area, obtaining a flag bit of the photo-taking session corresponding to the clicked thumbnail; when the value of the flag bit is a first preset value, determining that the first image has not been encoded; and converting the first image in the first format to a second image in the second format.

[0009] In one possible implementation of the first aspect, in response to a click operation on the thumbnail area, obtaining the flag bit of the shooting session corresponding to the clicked thumbnail includes: in response to a click operation on the thumbnail area, obtaining the unique identifier of the first thumbnail displayed in the thumbnail area; obtaining the unique identifier of the shooting session corresponding to the first thumbnail based on a pre-established mapping relationship between thumbnails and shooting sessions; and reading the value of the flag bit corresponding to the shooting session based on the unique identifier of the shooting session. In this way, determining whether the encoding of the first image has started by reading the value of the flag bit corresponding to the shooting session reduces the complexity of the determination process.

[0010] In one possible implementation of the first aspect, sending the shared information of the second image to the gallery application includes: storing the second image in a second memory space and directly sending the memory address of the second memory space to the gallery application, wherein the second memory space and the first memory space storing the first image are different storage spaces within the same memory block; the gallery application obtaining the second image based on the shared information includes: the gallery application reading the second image from the second memory space based on the memory address. In this way, the gallery app can directly read the real image from memory. Memory read speed is faster than disk read speed, shortening the time spent reading the second image and further improving the speed of displaying the real image.

[0011] In one possible implementation of the first aspect, after displaying the gallery application interface in response to a click on the thumbnail area, the method further includes: compressing the first image to obtain a compressed image, and encoding the compressed image to obtain an encoded image; sending the encoded image to the camera app, causing the camera app to update the encoded image in the media information library. It is evident that this solution simultaneously performs the encoding process of the first image during the conversion of the first image into a second image and its display, so as to update the encoded image corresponding to the first image in the media information library, so that when viewing the actual image corresponding to the thumbnail again, the corresponding actual image can be read from the media information and displayed.

[0012] In one possible implementation of the first aspect, after sending the encoded image to the camera app, the method further includes: in response to a click operation on a third thumbnail displayed on the thumbnail display interface of the gallery app, reading the encoded image corresponding to the third thumbnail from a media information library, wherein the third thumbnail has the same image content as the second thumbnail but a different size; the gallery app decodes and decompresses the encoded image corresponding to the third thumbnail to obtain a third image in a second format, and displays the third image on the image display interface.

[0013] In one possible implementation of the first aspect, both the first thumbnail and the second thumbnail are obtained based on thumbnail image data, the size of the second thumbnail is larger than that of the first thumbnail, and the thumbnail image data is obtained based on the captured image.

[0014] In one possible implementation of the first aspect, the electronic device includes a camera hardware abstraction module; when it is determined that the first image has not been encoded, the first image is converted from a first format to a second format to obtain a second image, and the shared information of the second image is sent to a gallery application, including: the camera application, in response to a click operation on a thumbnail area, sends a real image display notification to the camera hardware abstraction module, the real image display notification including a unique identifier of the first thumbnail; the camera hardware abstraction module, in response to the real image display notification, if it is determined based on the unique identifier of the first thumbnail that the first image has not been encoded, converts the first image from the first format to the second format to obtain a second image; the camera hardware abstraction module directly sends the shared information of the second image to the gallery application. Thus, when it is determined that the first image has not been encoded, the camera hardware abstraction module directly converts the first image to a second image in the second format and shares it with the gallery application for display. This process does not require encoding or decoding of the first image, thus saving the time consumed by encoding and decoding processes and improving the display speed of the real image.

[0015] In one possible implementation of the first aspect, the camera hardware abstraction module directly sends the shared information of the second image to the gallery application, including: the camera hardware abstraction module sends the shared information of the second image to the gallery application through a channel between the hardware abstraction module and the gallery application.

[0016] In one possible implementation of the first aspect, the camera hardware abstraction module sends shared information about the second image to the gallery application through a channel between the hardware abstraction module and the gallery application. This includes: the camera hardware abstraction module sending the memory address of a second memory space storing the second image to the gallery application through the channel between the hardware abstraction module and the gallery application. The second memory space and the first memory space storing the first image are different storage spaces within the same memory block. The gallery application obtains the second image based on the shared information, including: the gallery application reading the second image from the second memory space based on the memory address. The camera hardware abstraction module stores the second image in the memory space and sends the memory address of the second image to the gallery application. In this way, the gallery application can directly read and display the second image from memory. Memory read speed is faster than disk read speed, thus this scheme shortens the time spent reading the second image and further improves the speed of displaying the real image.

[0017] In one possible implementation of the first aspect, the process by which the camera hardware abstraction module determines whether encoding of the first image is currently underway based on the unique identifier of the first thumbnail includes: the camera hardware abstraction module parsing the real image display notification to obtain the unique identifier of the first thumbnail; the camera hardware abstraction module obtaining the unique identifier of the shooting session corresponding to the first thumbnail according to the pre-created mapping relationship between thumbnails and shooting sessions, and reading the value of the flag bit corresponding to the shooting session based on the unique identifier of the shooting session; when the value of the flag bit is a first preset value, it is determined that encoding of the first image is not currently underway; when the value of the flag bit is not the first preset value, it is determined that encoding of the first image is currently underway.

[0018] In one possible implementation of the first aspect, in response to a click on the thumbnail area, an image display interface of a gallery application is displayed, showing a second thumbnail. This includes: the camera application, in response to the click on the thumbnail area, sending a launch notification to the gallery application and transmitting thumbnail image data to the gallery application; and the gallery application, in response to the launch notification, displaying the image display interface, which includes the second thumbnail, obtained based on the thumbnail image data. In this way, after navigating from the camera application to the gallery application, the second thumbnail is displayed first, avoiding the situation where the gallery application's image display interface does not display any image before the actual image is obtained, thus preventing the user from perceiving a missing image.

[0019] Based on the thumbnail image data, after displaying the gallery application interface in response to a click operation on the thumbnail area, the method further includes: the camera abstraction module compressing the first image to obtain a compressed image, and encoding the compressed image to obtain an encoded image; the camera abstraction module sending the encoded image to the camera APP, causing the camera APP to update the encoded image to the media information library.

[0020] In one possible implementation of the first aspect, after the camera abstraction module sends the encoded image to the camera app, the method further includes: in response to a click operation on a third thumbnail displayed on the thumbnail display interface of the gallery app, the gallery app reads the encoded image corresponding to the third thumbnail from the media information library, wherein the third thumbnail has the same image content as the second thumbnail but a different size; the gallery app decodes and decompresses the encoded image corresponding to the third thumbnail to obtain a third image in a second format, and displays the third image on the image display interface.

[0021] Secondly, this application also provides an electronic device, comprising: one or more processors, a memory, and a touchscreen; the memory for storing program code; and the processor for running the program code, enabling the electronic device to: trigger the touchscreen to display a camera application's shooting interface, the shooting interface including a shooting button and a thumbnail area; in response to a click on the shooting button, perform image capture; trigger the thumbnail area displayed on the touchscreen to display a first thumbnail; in response to a click on the thumbnail area, trigger the touchscreen to display an image display interface of a gallery application, the image display interface displaying a second thumbnail, the second thumbnail and the first thumbnail being different sizes of the same image; if it is determined that the first image is not currently encoded, convert the first image from a first format to a second format to obtain a second image, and send the shared information of the second image to the gallery application, the first image being an image obtained after performing an image post-processing algorithm on the most recently captured image, and the second image being an unencoded image; the gallery application obtaining the second image based on the shared information, and triggering the display content of the image display interface displayed on the touchscreen to switch from the second thumbnail to the second image.

[0022] In one possible implementation of the second aspect, the processor is used to run program code that enables the electronic device to implement a photo display method as in any possible implementation of the first aspect.

[0023] Thirdly, this application also provides a computer-readable storage medium having instructions stored thereon that, when executed on an electronic device, cause the electronic device to perform a photograph display method as described in any of the first aspects.

[0024] Fourthly, this application also provides a computer program product having stored on it an executable that, when the computer program product is run on an electronic device, causes the electronic device to implement the photo display method as described in any of the first aspects.

[0025] It should be understood that the descriptions of technical features, technical solutions, beneficial effects, or similar language in this application do not imply that all features and advantages can be achieved in any single embodiment. Rather, it is understood that the description of a feature or beneficial effect means that a specific technical feature, technical solution, or beneficial effect is included in at least one embodiment. Therefore, the descriptions of technical features, technical solutions, or beneficial effects in this specification do not necessarily refer to the same embodiment. Furthermore, the technical features, technical solutions, and beneficial effects described in this embodiment can be combined in any suitable manner. Those skilled in the art will understand that embodiments can be implemented without one or more specific technical features, technical solutions, or beneficial effects of a particular embodiment. In other embodiments, additional technical features and beneficial effects may be identified in specific embodiments that do not embody all embodiments. Attached Figure Description

[0026] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0027] Figure 1 This is a schematic diagram of a photo display scene provided in an embodiment of this application;

[0028] Figure 2 This is a schematic diagram of a conventional photo display process provided in an embodiment of this application;

[0029] Figure 3 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application;

[0030] Figure 4 This is a schematic diagram of the software architecture of an electronic device provided in an embodiment of this application;

[0031] Figure 5 This is a schematic diagram of a photo display process provided in an embodiment of this application;

[0032] Figure 6 This is a flowchart of a photo display method provided in an embodiment of this application. Detailed Implementation

[0033] The terms "first," "second," and "third," etc., used in this application specification, claims, and drawings are used to distinguish different objects, not to limit a specific order.

[0034] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.

[0035] To better understand the photograph display method provided in the embodiments of this application, some terms involved in this application will be explained first:

[0036] Raw images, also known as original images, refer to images that have not been processed. Raw images can be understood as the raw data from which the light source signals captured by the camera's photosensitive element, such as complementary metal oxide semiconductor (CMOS) or charge coupled device (CCD), are converted into electrical signals.

[0037] A captured image refers to an image that is visible to the naked eye after the original image has been processed by an image signal processor (ISP), and then post-processed (such as image noise reduction, saturation processing, etc.) is performed.

[0038] A thumbnail is a low-resolution image cached in an electronic device. Compared to the captured image, a thumbnail has lower image quality, lower resolution, and a smaller display size. A thumbnail can include part or all of the content of the captured image.

[0039] Taking a mobile phone as an example, such as Figure 1 The image shown is a schematic diagram of the interface during the process of a mobile phone taking a photo.

[0040] like Figure 1 Figure (1) shows the shooting interface 100 of the mobile phone's camera application (APP). This interface includes a preview window 101 and an operation option area 102. Area 102 includes a shooting function option area 103, a thumbnail area 104, a shooting button 105, and a camera selection button 106. For example, the shooting function option area 103 may include large aperture, night scene, portrait, photo, video, professional, more, etc., and the function can be selected by swiping left and right in area 103. In addition, the indicator 107 indicates the currently selected function, for example, Figure 1 In the example shown in (1), indicator 107 indicates the photo-taking function.

[0041] After the electronic device receives a click operation on the capture button 105, the object in the capture preview window 101 receives the latest captured image, and the display of the electronic device is changed by... Figure 1 The shooting interface 100 shown in (1) is switched to Figure 1 The shooting interface 108 shown in (2) is as follows. Figure 1 As shown in (2), the thumbnail displayed in thumbnail area 104 has been updated to the thumbnail image corresponding to the most recently captured image (which can be called the first thumbnail), that is Figure 1 The preview window 101 of (1) displays a thumbnail image corresponding to the preview image. Combined with Figure 1 As shown in (1) and (2), Figure 1The thumbnail area 104 shown in (1) displays a thumbnail corresponding to the previously captured image. When a request is received... Figure 1 After pressing the shooting button 105 as shown in (1), switch to Figure 1 The interface shown in (2) displays a thumbnail image corresponding to the latest captured image in thumbnail area 104.

[0042] A thumbnail image is a low-resolution image cached in an electronic device. Compared to a captured image, a thumbnail image has lower image quality. The thumbnail image has a smaller resolution and a smaller display size than the captured image.

[0043] The thumbnail area 104 displays a thumbnail image corresponding to the most recently captured image. Simultaneously, the thumbnail area 104 serves as the entry point to the gallery application. When the electronic device receives a click on the thumbnail area 104, it switches to the gallery application and displays the most recently captured image corresponding to that thumbnail.

[0044] When the electronic device receives a Figure 1 After clicking on the thumbnail area 104 in (2), the page will redirect to... Figure 1 The image library application interface 200 shown in (3) includes an image display area 201 and a function button area 202 located at the bottom of the interface. The image display area 201 first displays a second thumbnail corresponding to the clicked thumbnail (which may be referred to as the first thumbnail). In one possible implementation, the first thumbnail and the second thumbnail are obtained based on the same thumbnail image data, wherein the display size of the first thumbnail is smaller than that of the second thumbnail.

[0045] The function button area 202 may include buttons such as share, favorite, edit, delete, and more.

[0046] After a period of time, the image displayed in the image display area of ​​the gallery application interface switches from the second thumbnail to the actual image, for example, from... Figure 1 The second thumbnail displayed in the image display area 201 shown in (3) is switched to Figure 1 The first true image 202 is shown in the image display area 201 shown in (4).

[0047] However, traditional methods for displaying captured photos take a long time to process the actual image, such as the initial time... Figure 1 (3) Switch to Figure 1 The (4) process takes a long time, resulting in a noticeable delay in the user experience.

[0048] Using the photograph display method provided in this application, from Figure 1 (3) Switch to Figure 1The process time of the second true graph 203 shown in (5) is the second duration, which is less than the first duration. For example, the first duration is 300-400ms, and the second duration can be tens of milliseconds.

[0049] The image quality of the second real image 203 is the same as that of the first real image 202 and is higher than that of the second thumbnail.

[0050] Figure 2 This diagram illustrates the traditional process of taking and displaying photographs.

[0051] like Figure 2 As shown, when the user clicks the camera app's capture button, the camera app's shooting process is triggered. The camera app uses the Camera Hardware Abstraction (CamHal) module to call the camera to take a picture, and the camera transmits the acquired image data to the Camera Hardware Abstraction module. CamHal generates a corresponding thumbnail image based on the image data and sends it to the camera app. Further, the camera application updates thumbnail area 104 with the thumbnail image generated by CamHal. Simultaneously, the CamHal module calls an image post-processing algorithm to process the image data.

[0052] The camera app receives a click from the user on the thumbnail area 104 of the shooting interface and switches to the gallery app. If the post-processing workflow for the corresponding thumbnail image is not yet complete, the gallery app displays the thumbnail image first.

[0053] The CamHal module performs image post-processing on the latest captured image data to obtain the first image, which is in YUV format. The CamHal module then compresses the first image to obtain a JPEG image. Further, the CamHal module encodes the JPEG image to obtain an encoded image, which is then sent to the camera app for storage. The camera app updates the media library with the encoded image. The gallery app reads the encoded image corresponding to the latest captured image from the media library, decodes and compresses it to obtain a third image in RGB format (i.e.,...). Figure 1 The first real image (202) is then displayed. The post-processing flow following image post-processing (mainly including encoding / decoding, updating the Media Library, and reading and displaying the real image from the library) takes approximately 300-400ms, which results in a noticeable delay in the user experience. For users, the faster they see the real image when viewing photos, the better the experience.

[0054] To improve the display speed of newly captured images for users, this application provides a method for quickly displaying recently captured photos. This method directly converts a first image in YUV format into a second image in RGB format, i.e. Figure 1 The second true image is shown. Further, through the channel between the Camhal module and the gallery app, the second image in RGB format is shared with the gallery app for display. The first true image is the true image obtained by encoding and decoding the first image in YUV format, while the second true image is the true image obtained by directly converting the first image in YUV format to RGB format without encoding and decoding. It is evident that the solution provided in this application saves the time overhead of post-image processing (such as encoding / decoding, updating the Media Library, and reading and displaying the true image), thus shortening the waiting time from clicking the thumbnail to displaying the true image. For example, the image format conversion process typically takes about 10-20ms, while the post-image processing typically takes about 300-400ms. Therefore, the time overhead of the format conversion process is negligible compared to the time overhead of the post-image processing. Thus, this solution can shorten the time for users to view the true image by 300-400ms.

[0055] The electronic device suitable for the photo display method provided in this application can be a mobile phone (e.g., Figure 1 The devices shown include tablets, desktops, laptops, ultra-mobile personal computers (UMPCs), handheld computers, netbooks, personal digital assistants (PDAs), wearable electronic devices, smartwatches, etc. This application does not specifically limit the specific form of the electronic device. In this embodiment, the structure of the electronic device can be as follows: Figure 3 As shown.

[0056] Please see Figure 3 The electronic device may include a processor, external memory interface, internal memory, universal serial bus (USB) interface, charging management module, power management module, battery, antenna 1, antenna 2, mobile communication module, wireless communication module, audio module, speaker, receiver, microphone, headphone jack, sensor module, buttons, motor, indicator, camera, display screen, and subscriber identification module (SIM) card interface, etc. For example, the sensor module may include pressure sensor, gyroscope sensor, barometric pressure sensor, magnetic sensor, accelerometer, distance sensor, proximity sensor, fingerprint sensor, temperature sensor, touch sensor, ambient light sensor, bone conduction sensor, etc.

[0057] It is understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device. In other embodiments, the electronic device may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0058] A processor may include one or more processing units, such as an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, and a digital signal processor (DSP). These different processing units may be independent devices or integrated into one or more processors.

[0059] The processor can also contain memory for storing instructions and data.

[0060] In some embodiments, the processor may include one or more interfaces. The processor connects to peripheral devices within an electronic device, such as sensors, cameras, displays, etc., through these interfaces.

[0061] Electronic devices can achieve shooting functions through ISPs, cameras, video codecs, GPUs, displays, and application processors.

[0062] A camera is used to capture still images or videos. An object passes through a lens, generating an optical image that is projected onto a photosensitive element. The photosensitive element converts the light signal into an electrical signal, which is then transmitted to an image processing unit (ISP) for conversion into a digital image signal.

[0063] An ISP (Image Signal Processor) processes data fed back from the camera. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's image sensor. The light signal is converted into an electrical signal, which is then transmitted to the ISP for processing, transforming it into a visible image. The ISP can also perform algorithmic optimizations on image noise, brightness, and skin tone. It can also optimize parameters such as exposure and color temperature for the shooting scene. In some embodiments, the ISP can be integrated into the camera itself.

[0064] The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into a standard RGB, YUV, or other image signal format. In some embodiments, the electronic device may include one or N cameras, where N is a positive integer greater than 1.

[0065] Digital signal processors (DSPs) are used to process digital signals. Besides digital image signals, they can also process other digital signals. For example, when an electronic device is selecting a frequency, a DSP can perform a Fourier transform on the frequency energy.

[0066] Furthermore, an operating system runs on top of the aforementioned components, for example, System. This application uses the layered architecture of the Android system as an example to illustrate the software structure of an electronic device.

[0067] Figure 4 This is a software structure block diagram of an electronic device according to an embodiment of this application.

[0068] A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer (APP), the application framework layer (FWK), the hardware abstraction layer (HAL), and the kernel layer.

[0069] The application layer can include a series of application packages. For example... Figure 4 As shown, the application package can include applications such as a camera and a gallery. The camera app is used to capture videos or images. The gallery app is used to store images or videos.

[0070] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.

[0071] In some embodiments, such as Figure 4 As shown, the application framework layer may include camera services and media information library (or media information library service).

[0072] Camera services, also known as interfaces for camera applications, are used to provide data transmission capabilities between camera applications and underlying modules.

[0073] The media information library provides information such as the storage path and name of videos and images used in the gallery application. The media information library can also store extended information about videos and images. The information stored in the media information library can be provided to the gallery application, which reads and displays the information for user viewing and operation. For example, in this embodiment, the camera application updates the media information library with the latest captured image, and the gallery application can read and display this image from the media information library.

[0074] The Hardware Abstraction Layer (HAL) is an interface layer located between the operating system kernel and the hardware circuitry. Its purpose is to abstract the hardware. It hides the hardware interface details of a specific platform, providing the operating system with a virtual hardware platform that is hardware independent and portable across multiple platforms.

[0075] In some embodiments, such as Figure 4 As shown, the hardware abstraction layer includes the camera hardware abstraction (CamHal). CamHal defines the interfaces that are called by the camera service and must be implemented so that upper-layer applications can correctly operate camera-related hardware (such as cameras).

[0076] In this embodiment, a new channel (e.g., an interface description language (HIDL) channel) is added between CamHal and the gallery app. CamHal transmits data to the gallery app through this channel. After receiving a click operation on the thumbnail image of the thumbnail area from the upper layer, CamHal directly converts the first image in YUV format to a second image in RGB format. The second image is then further transmitted to the gallery app for display through the channel between CamHal and the gallery app. This shortens the waiting time from clicking the thumbnail to displaying the actual image.

[0077] The kernel layer is the layer between hardware and software. The kernel layer includes at least display drivers, camera drivers, audio drivers, and sensor drivers.

[0078] It should be noted that although the embodiments of this application are illustrated using the Android system as an example, the basic principles are equally applicable to electronic devices based on other types of operating systems.

[0079] The following will combine Figure 5 The process of displaying photos provided in the embodiments of this application is described.

[0080] like Figure 5 As shown, in a scenario where the user immediately clicks the thumbnail on the shooting interface after clicking the photo button to view the captured image, the process of capturing the image and displaying the thumbnail after capturing the image is similar to... Figure 2 The same applies, so I will not repeat it here.

[0081] In one scenario, when the camera app receives a click on the first thumbnail of the shooting interface and switches to the gallery app, the gallery app will first display the second thumbnail image because the image post-processing process is not yet complete.

[0082] After performing image post-processing algorithms on the image data captured by the camera, a first image in YUV format is obtained. The CamHal module directly converts the first image in YUV format into a second image in RGB format. Furthermore, the second image is shared with the gallery app via the Hidden channel between CamHal and the gallery app. Upon receiving the second image, the gallery app switches from displaying the second thumbnail image to displaying the full second image (i.e., the full image). Figure 5 The first true image shown).

[0083] Meanwhile, CamHal compresses and encodes the first image to obtain an encoded image, which is then transmitted to the camera app. The camera app updates the encoded image in the Media Library of the FWK layer. Subsequently, if the user clicks on the thumbnail in the gallery app to view the corresponding real image, the gallery app can read the corresponding encoded image from the Media Library and decode and decompress it to obtain a third image in RGB format (i.e., Figure 5 The second true image shown is displayed.

[0084] As can be seen, during the post-processing of captured images by CamHal, upon receiving an operation to click on the thumbnail displayed in the thumbnail area of ​​the shooting interface (which can be referred to as the operation to view the corresponding real image of the latest captured image), this application triggers a rapid display of the real image. Specifically, it directly converts the first image in YUV format, which has undergone post-processing, into a second image in RGB format, and shares this second image with the gallery app via the channel between CamHal and the gallery app. This process does not require waiting for image encoding / decoding, Media Library updates, or other processing steps to complete before displaying the image, thus saving time spent on image encoding / decoding and other processing steps, and improving the speed of displaying the real image after shooting.

[0085] The following will combine Figure 6 This application provides a detailed description of the photo display method, which is applied to... Figure 3 The electronic devices shown include mobile phones, tablets, etc.

[0086] like Figure 6 As shown, the method may include the following steps:

[0087] S101: The camera app responds to the user's click on the shutter button by sending a photo-taking event to CamHal.

[0088] The camera app calls the CamHal in the hardware abstraction layer (HAL layer) through the camera service in the application framework layer. In other words, the camera app transmits the photo-taking event to the camera Hal through the camera service.

[0089] S102, CamHal responds to a photo-taking event by controlling the camera to take a picture and receiving the image captured by the camera.

[0090] For example, after determining the current shooting parameters (such as zoom level), CamHal can send a command to the camera driver to invoke the camera to take a picture. Once the camera is invoked, it begins taking pictures to obtain the raw image, and then sends the raw image to the image signal processor (ISP) for processing (such as registration and decoding) to obtain a digital image signal. The ISP then transmits the digital image signal to CamHal via the camera driver.

[0091] S103, CamHal generates a thumbnail image corresponding to the received image and transmits the thumbnail image to the camera app.

[0092] For example, the camera Hal can downsample the received digital image signal to obtain a thumbnail corresponding to the digital image signal. The thumbnail may include part or all of the original image. This application does not limit the specific content or generation method of the generated thumbnail. Furthermore, CamHal transmits the thumbnail image to the camera app.

[0093] S104, CamHal calls the image post-processing algorithm to process the received image data.

[0094] Image post-processing algorithms can perform post-processing on images, such as image enhancement and image scaling. Image enhancement includes, but is not limited to, noise reduction and saturation adjustment. It should be noted that image post-processing can include default processing of the initial image, or processing of the initial image based on the user-selected shooting mode. This application embodiment does not limit the specific content of image post-processing.

[0095] After CamHal performs image post-processing on the image captured by the camera, it obtains a first image in YUV format and stores it in a first memory space. This first memory space is allocated to CamHal. It stores data related to the image encoding process, such as the first image in YUV format. The first memory space is reclaimed after the encoding process is complete; in other words, the first image in YUV format stored in the first memory space is deleted after the encoding process is finished.

[0096] S105, the thumbnail area of ​​the camera app's shooting interface is updated to display the first thumbnail image.

[0097] In one exemplary embodiment, after receiving thumbnail image data transmitted by the camera Hal, the camera app obtains a first thumbnail based on the received thumbnail image data. The clarity and size of the first thumbnail may both be lower than those of the thumbnail image data. Furthermore, the display content of the thumbnail area of ​​the shooting interface is updated to this first thumbnail image, that is, the first thumbnail of the most recently captured image is displayed in the thumbnail area.

[0098] S106, in response to a click on the thumbnail area, the camera app sends a launch notification to the gallery app and transmits the received thumbnail image data to the gallery app.

[0099] When the camera app receives a click on the thumbnail area of ​​the shooting interface, it sends a launch notification to the gallery app to launch the gallery app. Simultaneously, it transmits the received thumbnail image data to the gallery app. In one possible implementation, the thumbnail image data can be included in the launch notification so that the gallery app immediately displays a second thumbnail corresponding to the clicked thumbnail upon launch, i.e., as shown below. Figure 1 The image display area 201 shown in (3) displays the second thumbnail.

[0100] The second thumbnail and the first thumbnail are two thumbnails of the same thumbnail image data but different sizes.

[0101] S107: In response to a click on the thumbnail area, the camera app sends a real image display notification to CamHal.

[0102] In addition, after the camera app receives a click on the thumbnail area, it generates a notification to display the real image and transmits it to CamHal via the camera service.

[0103] For example, each thumbnail has a unique identifier, such as a unique name or number. Optionally, the real image display notification carries the unique identifier of the currently clicked first thumbnail. In an exemplary embodiment, the first thumbnail may have the same unique identifier as the second thumbnail and the thumbnail image data used to generate the first and second thumbnails.

[0104] For example, S106 and S107 can be executed in parallel, or S107 can be executed first and then S106, or S106 can be executed first and then S107. This application does not limit the execution order of S106 and S107.

[0105] In step S108, CamHal responds to the real image display notification by determining whether the encoding process for the first image has started. If the encoding process has not started, step S109 is executed; if encoding is in progress or has been completed, step S112 is executed. It should be noted that starting the encoding process can include both the case of encoding in progress and the case of encoding completion.

[0106] In one exemplary embodiment, for each photo capture (preview or video recording) operation, the camera app creates a corresponding session (referred to as a photo capture session). Each session has a unique identifier, and the photo capture session is used to control the photo capture process of the camera device. The camera app passes information about the current photo capture session (such as the unique identifier of the photo capture session) carried in the photo capture event to the lower layer.

[0107] After CamHal receives an image captured by the camera and generates corresponding thumbnail image data, it establishes a mapping relationship between the image captured by the camera and the thumbnail image data and the unique identifier of the photo session. For example, it establishes a mapping relationship between the unique identifier of the captured image and the unique identifier of the thumbnail image data and the unique identifier of the photo session time.

[0108] CamHal sets a corresponding flag for each photo-taking session to indicate whether the session is currently in encoding mode. For example, the initial value of the flag is "0", indicating that the session is not in encoding mode. When CamHal performs the image encoding process, it sets the flag for the corresponding session to "1". For example, after the image encoding process is completed, the flag remains at "1".

[0109] In an exemplary embodiment, CamHal parses the received real image display notification to obtain the unique identifier of the thumbnail, further determines the unique identifier of the shooting session corresponding to the clicked thumbnail based on the mapping relationship between the thumbnail and the shooting session, and reads the value of the corresponding flag bit based on the unique identifier of the shooting session, thereby determining whether the first image corresponding to the clicked thumbnail is undergoing an image encoding process based on the value of the flag bit.

[0110] S109, CamHal converts the first image in YUV format to obtain a second image in RGB format.

[0111] For example, CamHal includes a format conversion module. After determining that the encoding process for the first image is not currently being executed, CamHal reads the first image in YUV format from the first memory space and converts the first image in YUV format to RGB format through the format conversion module, thus obtaining the second image in RGB format.

[0112] In one exemplary embodiment, the second image can be stored in a second memory space. The second memory space is also the memory space allocated for CamHal; in other words, the second memory space and the first memory space belong to the same memory block allocated for CamHal, but the memory addresses corresponding to the second memory space and the first memory space are different.

[0113] S110, CamHal sends the sharing information of the second image to the Gallery App through the channel between CamHal and the Gallery App.

[0114] In one exemplary embodiment, such as Figure 4 As shown, a new channel, such as the Hidl channel, is opened between CamHal and the gallery app. CamHal uses this channel to transmit shared information about the second image to the gallery app.

[0115] In one exemplary embodiment, CamHal can share a second image with a gallery app via memory sharing. For example, the sharing information may include the memory address of the memory space storing the second image (i.e., the memory address). That is, the memory address storing the second image can be sent to the gallery app, and the gallery app can directly read the second image based on the memory address.

[0116] S111, the gallery app displays the second image.

[0117] In S107, the gallery app displays a second thumbnail. When the gallery app receives shared information (e.g., memory address) of the second image sent by CamHal, it reads the second image from memory, and the gallery app's interface switches from displaying the second thumbnail to displaying the second image. Moreover, memory read / write speed is higher than disk speed, so the gallery app can quickly read and display the second image.

[0118] As described above, in scenarios where the first thumbnail of the latest captured image is displayed in the thumbnail area of ​​the shooting interface, and the corresponding real image is viewed immediately upon clicking on that area, CamHal directly converts the first image (YUV format) obtained after image post-processing into a second image (RGB format). Furthermore, the second image is stored in memory and shared with the gallery app via memory sharing. This means the gallery app can directly read and display the second image from this memory space. Firstly, this solution saves time spent on subsequent processing of the first image (such as image encoding / decoding, updating the MediaLibrary, and reading the real image), thus speeding up the display of the real image. Moreover, the gallery app reads the real image directly from memory, and memory read speed is faster than disk read speed, reducing the time spent reading the second image and further improving the speed of displaying the real image.

[0119] Furthermore, in an exemplary embodiment, while performing the above-described S109 to S110, the compression and encoding process of the first image can also be performed, that is, the process described in subsequent S112 to S115, that is, S109 to S110 and S112 to S115 are executed in parallel.

[0120] In another exemplary embodiment, S112-S115 may be executed after S109-S110 is completed. Therefore, in this embodiment, processes S109-S100 and S112-S115 can be executed in parallel, or S109-S110 can be executed first followed by S112-S115; this application does not limit this.

[0121] In another exemplary embodiment, if it is determined in step S108 that the encoding process of the first image corresponding to the clicked thumbnail is currently being executed, then the steps shown in S112 to S115 are executed directly.

[0122] S112, CamHal compresses and encodes the first image to obtain an encoded image.

[0123] In one scenario, after CamHal receives a real image display notification from the camera app, the status code of the image encoding process is "1", indicating that the encoding process for the latest captured image is currently being executed. In this scenario, the encoding process of the first image continues. For example, the first image is first compressed to obtain a JPEG format image, and then the JPEG format image is encoded to obtain an encoded image.

[0124] S113, CamHal sends encoded images to the camera app.

[0125] CamHal compresses and encodes the first image to obtain an encoded image, which is then transmitted to the camera app.

[0126] S114, the camera app saves encoded images.

[0127] The camera app saves the received encoded image to the camera app's corresponding memory space.

[0128] S115, the camera app sends the encoded image to the Media Library.

[0129] The camera app updates the received encoded image to the Media Library, meaning it stores the encoded image there. Furthermore, the Media Library stores a mapping between encoded images and thumbnails. The gallery app can then use this mapping to read the encoded image corresponding to the clicked thumbnail from the Media Library, further decode and decompress it to obtain a third image in RGB format, and display it.

[0130] For example, each thumbnail can have a unique identifier (such as a name or number), and similarly, the encoded image also has a unique identifier (name or number). A mapping relationship can be established between the unique identifiers of the thumbnails and the unique identifiers of the encoded images. The unique identifier of the encoded image can be the same as the unique identifier of the first image in YUV format, or the unique identifiers of the encoded image and the first image can be different; this application does not impose any limitations on this. Furthermore, the storage space corresponding to the Media Library is located on a disk.

[0131] In one scenario, when an operation to click on a thumbnail area is received, the first image corresponding to the clicked thumbnail has not been encoded. In this case, executing S109-S111 above allows the gallery app to display the actual image (i.e., the second image) corresponding to the clicked thumbnail; that is, the gallery app switches from displaying the second thumbnail to displaying the second image. Further, after executing S112-S115, the encoded image of the actual image corresponding to the clicked thumbnail is updated in the Media Library. When the gallery app receives another operation to view the actual image corresponding to the thumbnail, the gallery app can directly read the encoded image corresponding to the thumbnail from the Media Library, further decode and decompress the encoded image to obtain the third image, and display it; that is, the gallery app switches from displaying the second thumbnail to displaying the third image.

[0132] In another scenario, when a click on a thumbnail area is received, the encoding process for the first image corresponding to the clicked thumbnail is in progress, or has already been completed. In this case, after updating the encoded image of the actual image corresponding to the thumbnail to the Media Library, the gallery app reads the encoded image corresponding to the thumbnail from the Media Library, further decodes and decompresses the encoded image to obtain the third image, and displays it. That is, the gallery app directly switches from displaying the second thumbnail to displaying the third image.

[0133] In one example, the thumbnail's unique identifier is A, and the encoded image's unique identifier is B. When the gallery app receives a click action from the user on thumbnail A, it reads the encoded image corresponding to thumbnail A based on the mapping between thumbnails and encoded images stored in the Media Library. The encoded image is then decoded and decompressed to obtain a third image in RGB format, which is then displayed, thus enabling the viewing of the actual image from the gallery app.

[0134] The processes described in S112-S115 above are processing flows in a scenario where a click operation on a thumbnail of the shooting interface is detected, and the first image corresponding to the clicked thumbnail is being encoded (or has been encoded). Specifically, after the image encoding process is completed, the encoded image is sent to the camera app. Furthermore, the camera app updates the encoded image in the Media Library. The gallery app can directly read the encoded image corresponding to the clicked thumbnail from the Media Library, further decode and decompress the read encoded image to obtain a third image in RGB format, and then display it, thereby achieving the display of the actual image when the thumbnail is clicked.

[0135] In another exemplary embodiment, after the gallery app displays the second image in RGB format in S111, and after executing S112 to S115, the gallery app is still in the state of displaying the second image corresponding to the clicked thumbnail. In this scenario, the gallery app reads the third image in RGB format corresponding to the clicked thumbnail from the Media Library and updates the second image displayed in the image display area to the third image. This eliminates the need to display the second image again, thus freeing up the second memory space used to store the second image and improving memory space utilization.

[0136] The photo display method provided in this embodiment, upon detecting a click operation on a thumbnail image in the thumbnail area of ​​the shooting interface, determines whether to perform an encoding process on the image corresponding to the clicked thumbnail image. If no encoding process is performed, a fast real image display process is triggered. That is, the first image in the first format obtained after image post-processing is directly converted into a second image in the second format, and the memory address of the second image is directly shared with the gallery app. The gallery app directly reads the second image from the memory space according to the memory address and displays it. It can be seen that this solution does not require an image encoding process before displaying the real image, thus saving the time consumed by the image encoding process and speeding up the display of the real image. Moreover, when displaying the real image, the gallery app directly reads the second image from memory. Memory read speed is faster than disk read speed, shortening the time spent reading the real image and further improving the speed of displaying the real image.

[0137] Figure 6The embodiment shown detects an operation that clicks on the thumbnail area of ​​the shooting interface. If it is determined that the first image corresponding to the clicked thumbnail has not yet undergone an encoding process, the first image in YUV format is directly converted into a second image in RGB format and shared with the gallery APP for display.

[0138] In another embodiment of this application, if it is determined that the encoding process for the first image corresponding to the clicked thumbnail has not yet been completed (i.e., encoding has not started or is in progress), CamHal can read the first image in YUV format from the first memory space corresponding to CamHal, convert it into a second image in RGB format, and write it into the second memory space corresponding to CamHal. Further, CamHal sends the address of the second memory space to the gallery app, and the gallery app reads the second image from the second memory space and displays it. If it is determined that the encoding process for the first image corresponding to the clicked thumbnail has been completed, then... Figure 6 The processes shown in S113 to S115 are as follows: the encoded image is sent to the camera app for saving; the camera app updates the encoded image to the Media Library; the gallery app reads the encoded image corresponding to the clicked thumbnail from the Media Library, and decodes and decompresses it to obtain a third image in RGB format for display.

[0139] In another embodiment of this application, CamHal can also directly convert the first image in YUV format to a second image in RGB format and write it into the second memory space allocated to CamHal after completing image post-processing. Simultaneously, the compression and encoding process of the first image, i.e., after completing image post-processing, is executed in parallel with the aforementioned S109-S110 and S112-S115. Afterwards, upon receiving an operation on the thumbnail area of ​​the shooting interface, it is determined whether the encoding process of the first image corresponding to the clicked thumbnail has been completed. If encoding is not completed (i.e., encoding has not started or is in progress), CamHal sends the sharing information of the second image to the gallery app, and the gallery app directly reads the second image from memory and displays it. If the encoding process has been completed, the gallery app reads the encoded image corresponding to the clicked thumbnail from the Media Library, decodes and decompresses the encoded image to obtain a third image in RGB format, and displays it.

[0140] Through the above description of the embodiments, those skilled in the art will clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device, and unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0141] In the several embodiments provided in this example, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.

[0142] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0143] Furthermore, in each embodiment of this invention, the functional units can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0144] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments. The aforementioned storage medium includes various media capable of storing program code, such as flash memory, portable hard disk, read-only memory, random access memory, magnetic disk, or optical disk.

[0145] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for displaying photographs, characterized in that, Applied to electronic devices, the method includes: The camera app's shooting interface is displayed, which includes a shooting button and a thumbnail area; In response to a click on the shutter button, an image is captured; The thumbnail area displays the first thumbnail; In response to a click on the thumbnail area, an image display interface of the gallery application is displayed, which displays a second thumbnail, the second thumbnail and the first thumbnail being different sizes of the same image; If it is determined that the first image has not been encoded, the first image is converted from the first format to the second format to obtain the second image, and the sharing information of the second image is sent to the image library application. The first image is the image obtained after performing image post-processing algorithm on the most recently captured image, and the second image is the unencoded image. The image library application obtains the second image based on the shared information and switches the display content of the image display interface from the second thumbnail to the second image.

2. The method according to claim 1, characterized in that, The step of converting the first image from a first format to a second format to obtain a second image when it is determined that the first image has not been encoded includes: In response to a click operation on the thumbnail area, obtain the flag bit of the photo session corresponding to the clicked thumbnail; When the value of the flag bit is a first preset value, it is determined that the first image has not been encoded at present; Convert the first image in the first format to the second image in the second format.

3. The method according to claim 2, characterized in that, The step of responding to a click operation on the thumbnail area by obtaining the flag of the photo-taking session corresponding to the clicked thumbnail includes: In response to a click operation on the thumbnail area, obtain the unique identifier of the first thumbnail displayed in the thumbnail area; Based on the pre-established mapping relationship between thumbnails and photo sessions, a unique identifier for the photo session corresponding to the first thumbnail is obtained; The value of the flag bit corresponding to the photo-taking session is read based on the unique identifier of the photo-taking session.

4. The method according to claim 1 or 2, characterized in that, Sending the shared information of the second image to the gallery application includes: storing the second image in a second memory space and directly sending the memory address of the second memory space to the gallery application. The second memory space and the first memory space storing the first image are different storage spaces within the same memory block. The gallery application obtains the second image based on the shared information, including: the gallery application reads the second image from the second memory space based on the memory address.

5. The method according to any one of claims 1-3, characterized in that, After displaying the gallery application's interface in response to a click on the thumbnail area, the method further includes: The first image is compressed to obtain a compressed image, and the compressed image is encoded to obtain an encoded image; The encoded image is sent to the camera app, causing the camera app to update the encoded image to the media information library.

6. The method according to claim 5, characterized in that, After sending the encoded image to the camera app, the method further includes: In response to a click operation on a third thumbnail displayed on the thumbnail display interface of the gallery application, an encoded image corresponding to the third thumbnail is read from the media information library. The third thumbnail has the same image content as the second thumbnail but a different size. The image library application decodes and decompresses the encoded image corresponding to the third thumbnail to obtain the third image in the second format, and displays the third image on the image display interface.

7. The method according to any one of claims 1-3 or 6, characterized in that, Both the first thumbnail and the second thumbnail are obtained based on thumbnail image data. The second thumbnail is larger than the first thumbnail. The thumbnail image data is obtained based on the captured image.

8. The method according to any one of claims 1-3 or 6, characterized in that, The electronic device includes a camera hardware abstraction module; The step of converting the first image from a first format to a second format to obtain a second image when it is determined that the first image is not currently being encoded, and sending the shared information of the second image to the image library application, includes: In response to a click on the thumbnail area, the camera app sends a real image display notification to the camera hardware abstraction module. The real image display notification includes the unique identifier of the first thumbnail. In response to the real image display notification, the camera hardware abstraction module converts the first image from the first format to the second format to obtain the second image if it is determined based on the unique identifier of the first thumbnail that the first image has not been encoded. The camera hardware abstraction module directly sends the shared information of the second image to the gallery application.

9. The method according to claim 8, characterized in that, The camera hardware abstraction module directly sends the shared information of the second image to the gallery application, including: The camera hardware abstraction module sends the shared information of the second image to the gallery application through the channel between the camera hardware abstraction module and the gallery application.

10. The method according to claim 9, characterized in that, The camera hardware abstraction module sends the shared information of the second image to the gallery application through the channel between the camera hardware abstraction module and the gallery application, including: the camera hardware abstraction module sends the memory address of the second memory space storing the second image to the gallery application through the channel between the camera hardware abstraction module and the gallery application, wherein the second memory space and the first memory space storing the first image are different storage spaces of the same memory block; The gallery application obtains the second image based on the shared information, including: the gallery application reads the second image from the second memory space based on the memory address.

11. The method according to claim 8, characterized in that, The process by which the camera hardware abstraction module determines whether it is currently encoding the first image based on the unique identifier of the first thumbnail includes: The camera hardware abstraction module parses the real image display notification to obtain the unique identifier of the first thumbnail; The camera hardware abstraction module obtains the unique identifier of the shooting session corresponding to the first thumbnail based on the pre-created mapping relationship between thumbnails and shooting sessions, and reads the value of the flag bit corresponding to the shooting session based on the unique identifier of the shooting session; When the value of the flag bit is a first preset value, it is determined that the first image has not been encoded at present; When the value of the flag bit is not the first preset value, it is determined that the first image is currently being encoded.

12. The method according to claim 8, characterized in that, In response to a click on the thumbnail area, the image display interface of the gallery application is displayed, and the image display interface displays a second thumbnail, including: In response to a click on the thumbnail area, the camera app sends a launch notification to the gallery app and transmits thumbnail image data to the gallery app. In response to the launch notification, the gallery application displays an image display interface, which shows the second thumbnail, which is obtained based on the thumbnail image data.

13. The method according to claim 12, characterized in that, After displaying the gallery application's interface in response to a click on the thumbnail area, the method further includes: The camera hardware abstraction module compresses the first image to obtain a compressed image, and encodes the compressed image to obtain an encoded image; The camera hardware abstraction module sends the encoded image to the camera APP, causing the camera APP to update the encoded image to the media information library.

14. The method according to claim 13, characterized in that, After the camera hardware abstraction module sends the encoded image to the camera app, the method further includes: In response to a click operation on the third thumbnail displayed on the thumbnail display interface of the gallery application, the gallery application reads the encoded image corresponding to the third thumbnail from the media information library. The third thumbnail has the same image content as the second thumbnail but a different size. The image library application decodes and decompresses the encoded image corresponding to the third thumbnail to obtain the third image in the second format, and displays the third image on the image display interface.

15. An electronic device, characterized in that, The electronic device includes: one or more processors, a memory, and a touchscreen; the memory is used to store program code; the processor is used to run the program code, enabling the electronic device to: The touchscreen is triggered to display the camera app's shooting interface, which includes a shooting button and a thumbnail area; In response to a click on the shutter button, an image is captured; The touchscreen is triggered to display a first thumbnail in the thumbnail area; In response to a click on the thumbnail area, the touchscreen is triggered to display an image display interface of the gallery application, which displays a second thumbnail. The second thumbnail and the first thumbnail are different sizes of the same image. If it is determined that the first image has not been encoded, the first image is converted from the first format to the second format to obtain the second image, and the sharing information of the second image is sent to the image library application. The first image is the image obtained after performing image post-processing algorithm on the most recently captured image, and the second image is the unencoded image. The gallery application obtains the second image based on the shared information and triggers the display content of the image display interface on the touch screen to switch from the second thumbnail to the second image.

16. The electronic device according to claim 15, characterized in that, The processor is used to run the program code, causing the electronic device to implement the photo display method as described in any one of claims 2 to 14.

17. A computer-readable storage medium, characterized in that, It stores instructions that, when executed on an electronic device, cause the electronic device to perform the photo display method as described in any one of claims 1 to 14.

Citation Information

Patent Citations

  • Shooting method and mobile terminal

    CN107509038A

  • Shooting method, electronic equipment and system

    CN116264634A