A thumbnail display method and an electronic device
Patent Information
- Application Number
- CN202580011681.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2024-01-26
- Filing Date
- 2025-01-23
- Publication Date
- 2026-09-25
AI Technical Summary
Electronic devices are prone to white blocks when quickly switching to display multiple pictures, resulting in poor display.
The electronic device first displays the thumbnails with smaller sizes and decodes the thumbnails with larger sizes in the background. After the decoding is completed, replaces the smaller thumbnails in the display area.
It improves the speed of displaying thumbnails by electronic devices, avoids white blocks, and improves the user's browsing experience.
Smart Images

Figure CN122826850A_ABST
Abstract
Description
Thumbnail display method and electronic device
[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on January 26, 2024, with application number 202410115867.5 and application name “A Thumbnail Display Method and Electronic Device”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] Embodiments of the present application relate to the field of electronic technology, and more particularly, to a thumbnail display method and electronic device. Background Art
[0003] When displaying images, electronic devices often need to quickly switch between displayed images as the user swipes. For example, when a user quickly browses through image thumbnails in a gallery application, the electronic device displays a large number of thumbnails at once. Rapid swiping can easily cause the electronic device to display white blocks. Summary of the Invention
[0004] The present application provides a display method and electronic device. This technical solution allows an electronic device to first display a smaller thumbnail when displaying thumbnails of a target image. The electronic device can read smaller thumbnails faster, thereby improving the speed at which the electronic device displays thumbnails and avoiding the phenomenon of white blocks appearing when displaying multiple thumbnails at once.
[0005] In a first aspect, a thumbnail display method is provided, which is applied to an electronic device, and the method includes: in response to a first operation that causes the electronic device to display a thumbnail of a target image, obtaining a first target thumbnail and a second target thumbnail, wherein the first target thumbnail and the second target thumbnail are thumbnails of different sizes of the target image, and the size of the first target thumbnail is larger than the size of the second target thumbnail; displaying the second target thumbnail in a display area for displaying thumbnails of the target image; decoding the first target thumbnail; and after the decoding of the first target thumbnail is completed, replacing the second target thumbnail in the display area with the first target thumbnail.
[0006] Exemplarily, the first target thumbnail may be a daily thumbnail, and the second target thumbnail may be a monthly thumbnail, a yearly thumbnail, or other thumbnail smaller in size than the daily thumbnail.
[0007] Exemplarily, the first operation may be an operation for displaying a first target thumbnail of the target picture.
[0008] Based on an embodiment of the present application, in response to a first operation that causes an electronic device to display a thumbnail of a target image, the electronic device can obtain a first target thumbnail with a larger size and a second target thumbnail with a smaller size of the target image, and display the second target thumbnail with a smaller size in a display area for implementing the thumbnail of the target image; and decode the first target thumbnail in the background, and after the decoding of the first target thumbnail is completed, use the first target thumbnail to replace the second target thumbnail in the display area.
[0009] In this way, when displaying the thumbnail of the target image, the electronic device can first display the smaller thumbnail. The electronic device reads the smaller thumbnail faster, thereby improving the speed at which the electronic device displays thumbnails and avoiding the phenomenon of displaying white blocks when displaying multiple thumbnails at one time.
[0010] In combination with the first aspect, in certain implementations of the first aspect, when the electronic device stores the first target thumbnail and the second target thumbnail, the encoding compression rate of the first target thumbnail is greater than the encoding compression rate of the second target thumbnail; or, the first target thumbnail is stored in a format that requires encoding compression, and the second target thumbnail is stored in a format that does not require encoding compression.
[0011] For example, the first target thumbnail has a higher encoding compression ratio, for example, the first target thumbnail may be stored in JPG or PNG format. The second target thumbnail has a lower encoding compression ratio, for example, the second target thumbnail may be stored in a texture format. Alternatively, the second target thumbnail may be stored in a format that does not require encoding compression, for example, the second target thumbnail may be stored in a bitmap format.
[0012] It should be understood that the storage format that does not require coding compression can also be understood as a storage format with a coding compression rate of 0.
[0013] Based on the embodiment of the present application, the encoding compression rate of the first target thumbnail is greater than the encoding compression rate of the second target thumbnail, or the first target thumbnail is stored in a format that requires encoding compression, and the second target thumbnail is stored in a format that does not require encoding compression.
[0014] In this way, the electronic device can quickly display the second target thumbnail, thereby avoiding the phenomenon of displaying a white block.
[0015] In combination with the first aspect, in certain implementations of the first aspect, in response to a first operation causing the electronic device to display a thumbnail of a target picture, obtaining the first target thumbnail and the second target thumbnail includes: in response to the first operation, obtaining the index of the first target thumbnail and the index of the second target thumbnail; and obtaining the first target thumbnail and the second target thumbnail according to the index of the first target thumbnail and the index of the second target thumbnail.
[0016] Based on the embodiment of the present application, the electronic device can obtain the first target thumbnail according to the index of the first target thumbnail, and obtain the second target thumbnail according to the index of the second target thumbnail, so that the electronic device can quickly obtain the thumbnails.
[0017] In combination with the first aspect, in certain implementations of the first aspect, before responding to the first operation, the method further includes: for a thumbnail of a target size, creating a target file for storing the thumbnail of the target size, wherein the target file has a continuous storage space of a first target size; when storing the thumbnail of the target size, writing the thumbnail of the target size into the continuous storage space of the target file according to the index information of the target file.
[0018] Based on the embodiment of the present application, for a thumbnail of a target size, the electronic device can be used to store a target file of the thumbnail, which has a continuous storage space. When storing a thumbnail of a target size, the electronic device stores it in the continuous storage space of the target file.
[0019] In this way, when the electronic device stores multiple thumbnails, it can achieve continuous storage of the thumbnails, avoiding scattered storage of the multiple thumbnails, so that when the thumbnails need to be read later, the thumbnails can be read continuously, thereby improving the speed of reading thumbnails.
[0020] In combination with the first aspect, in certain implementations of the first aspect, writing the thumbnail of the target size into the continuous storage space of the target file based on the index information of the target file includes: determining the next available storage space in the continuous storage space based on the index information; and writing the thumbnail of the target size into the next available storage space.
[0021] Based on the embodiment of the present application, the target file may have index information, so that when the electronic device stores thumbnails, it can query the next available storage space through the index information and store the thumbnail in the next available storage space, thereby realizing continuous storage of thumbnails.
[0022] In combination with the first aspect, in certain implementations of the first aspect, the electronic device allocates the same storage space to thumbnails of the same target size.
[0023] Based on the embodiment of the present application, the electronic device allocates the same storage space for thumbnails of the same target size, which can improve the performance of the electronic device in reading thumbnails.
[0024] In combination with the first aspect, in some implementations of the first aspect, the method further includes: when the continuous storage space of the target file is full, allocating continuous storage space of a second target size to the target file.
[0025] Exemplarily, the second target size may be M times the first target size, where M is a positive integer.
[0026] It should be understood that the continuous storage space of the first target size and the continuous storage space of the second target size may be continuous or discontinuous.
[0027] Based on the embodiment of the present application, when the continuous storage space of the target file is full, the electronic device continues to allocate continuous storage space of a second target size for the target file, so that subsequently stored thumbnails can also be stored continuously.
[0028] In combination with the first aspect, in certain implementations of the first aspect, the storage format of the second target thumbnail includes a bitmap or a texture.
[0029] It is understandable that the storage format of the second target thumbnail may also include other storage formats with lower encoding compression rates, or other storage formats that do not require encoding compression.
[0030] Based on the embodiment of the present application, the storage format of the second target thumbnail includes a bitmap or texture, so that the electronic device does not need to decode when displaying the second target thumbnail, thereby increasing the speed at which the electronic device displays thumbnails and avoiding the phenomenon of displaying white blocks.
[0031] In combination with the first aspect, in certain implementations of the first aspect, the first operation is an operation for triggering the electronic device to display a thumbnail of a first target size, and the first target size is the size of the first target thumbnail. The method also includes: in response to a second operation that causes the electronic device to display a thumbnail of the target image, obtaining the second target thumbnail, wherein the second operation is an operation for triggering the electronic device to display a thumbnail of a second target size, the second target size is the size of the second target thumbnail, and the second target size is smaller than the first target size; and displaying the second target thumbnail in the display area.
[0032] For example, the first target size may be 256*256, and the second target size may be 128*128 or 64*64, etc.
[0033] Based on the embodiment of the present application, in response to the second operation that causes the electronic device to display a thumbnail of the second target size, the electronic device can obtain the second target thumbnail and directly display the second target thumbnail. This can improve the speed of the electronic device displaying thumbnails and avoid displaying white blocks.
[0034] In combination with the first aspect, in some implementations of the first aspect, the method further includes: when the decoding of the first target thumbnail is not completed and it is determined that the first target thumbnail does not need to be displayed further, canceling the decoding operation on the first target thumbnail.
[0035] According to an embodiment of the present application, if the decoding of the first target thumbnail is not complete and the electronic device determines that it does not need to continue displaying the first target thumbnail, the decoding operation on the first target thumbnail is canceled. This technical solution can avoid decoding the first target thumbnail when it is not needed to be displayed, thereby saving power consumption of the electronic device.
[0036] In combination with the first aspect, in some implementations of the first aspect, determining that the first target thumbnail does not need to be displayed any more includes: when the electronic device no longer displays the display area, determining that the first target thumbnail does not need to be displayed any more.
[0037] The electronic device no longer displays the display area, which may include the electronic device needing to display other thumbnails following the user's sliding operation; or the electronic device responding to the user's operation of exiting the gallery, etc.
[0038] Based on the embodiment of the present application, the electronic device can determine whether it needs to continue displaying the first target thumbnail.
[0039] In a second aspect, an electronic device is provided, comprising: one or more processors; one or more memories; the one or more memories storing one or more programs, which, when executed by one or more processors, enable the thumbnail display method described in the first aspect and any possible implementation thereof to be executed.
[0040] In a third aspect, a thumbnail display device is provided, comprising a module for implementing the thumbnail display method as described in the first aspect and any possible implementation thereof.
[0041] In a fourth aspect, a chip is provided, comprising a processor and a communication interface, wherein the communication interface is used to receive a signal and transmit the signal to the processor, and the processor processes the signal so that the thumbnail display method described in the first aspect and any possible implementation thereof is executed.
[0042] In a fifth aspect, a readable storage medium is provided, wherein instructions are stored in the readable storage medium. When the instructions are executed on an electronic device, the thumbnail display method described in the first aspect and any possible implementation thereof is executed.
[0043] In a sixth aspect, a program product is provided, comprising a program code. When the program code is run on an electronic device, the thumbnail display method as described in the first aspect and any possible implementation thereof is executed. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] FIG1 is a schematic structural diagram of an electronic device provided in an embodiment of the present application.
[0045] FIG2 is a schematic diagram of the software structure of the electronic device provided in an embodiment of the present application.
[0046] FIG3 is a schematic diagram of a scenario to which an embodiment of the present application can be applied.
[0047] FIG4 is a schematic diagram of a system architecture provided in an embodiment of the present application.
[0048] FIG5 is a schematic diagram of a file organization method provided in an embodiment of the present application.
[0049] FIG6 is a schematic diagram of a user mode module provided in an embodiment of the present application.
[0050] FIG7 is a schematic diagram of another file organization method provided in an embodiment of the present application.
[0051] FIG8 is a schematic diagram of allocating continuous storage space provided in an embodiment of the present application.
[0052] FIG9 is a schematic flowchart of a method for continuously storing thumbnails provided in an embodiment of the present application.
[0053] FIG10 is a schematic flowchart of a thumbnail reading method provided in an embodiment of the present application.
[0054] FIG11 is a schematic flowchart of another method of reading thumbnails provided in an embodiment of the present application.
[0055] FIG12 is a schematic flowchart of a thumbnail display method provided in an embodiment of the present application.
[0056] FIG13 is a schematic block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0057] The technical solution in this application will be described below with reference to the accompanying drawings.
[0058] The thumbnail display method in the embodiments of the present application can be applied to electronic devices such as smartphones, tablet computers, laptops, personal computers (PCs), ultra-mobile personal computers (UMPCs), netbooks, vehicle-mounted devices, wearable devices, foldable devices, and Internet of Things (IOT) devices.
[0059] 1 shows a schematic structural diagram of an electronic device 100. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identification module (SIM) card interface 195. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0060] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0061] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.
[0062] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0063] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.
[0064] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus interface.
[0065] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL).
[0066] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to enable communication between the processor 110 and the audio module 170.
[0067] The PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface.
[0068] The UART interface is a universal serial data bus used for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 110 and the wireless communication module 160.
[0069] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193.
[0070] The GPIO interface can be configured via software. The GPIO interface can be configured as a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc.
[0071] The USB interface 130 is an interface that complies with USB standards, and may be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 may be used to connect a charger to charge the electronic device 100, and may also be used to transfer data between the electronic device 100 and peripheral devices.
[0072] It is understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is merely an illustrative illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.
[0073] The charging management module 140 is configured to receive charging input from a charger. The charger can be either a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also provide power to the electronic device via the power management module 141.
[0074] The power management module 141 is used to connect the battery 142 , the charging management module 140 and the processor 110 .
[0075] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0076] The mobile communication module 150 can provide wireless communication solutions including 2G / 3G / 4G / 5G applied on the electronic device 100.
[0077] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0078] The wireless communication module 160 can provide wireless communication solutions for application on the electronic device 100, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), Bluetooth low energy (BLE), global navigation satellite system (GNSS), frequency modulation (FM), near field communication technology (NFC), infrared technology (IR), etc.
[0079] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150 , and antenna 2 is coupled to wireless communication module 160 , so that electronic device 100 can communicate with the network and other devices through wireless communication technology.
[0080] Electronic device 100 implements display functionality through a GPU, display screen 194, and an application processor. A GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.
[0081] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), or a display panel made of one of the following materials: organic light-emitting diode (OLED), active-matrix organic light-emitting diode (AMOLED), flexible light-emitting diode (FLED), MiniLED, MicroLed, Micro-oLed, or quantum dot light-emitting diode (QLED). In some embodiments, electronic device 100 can include one or N display screens 194, where N is a positive integer greater than 1.
[0082] The electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.
[0083] The ISP is used to process data fed back by the camera 193. The camera 193 is used to capture still images or videos.
[0084] Digital signal processors are used to process digital signals. In addition to processing digital image signals, they can also process other digital signals.
[0085] Video codecs are used to compress or decompress digital video.
[0086] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100.
[0087] The internal memory 121 may be used to store computer executable program codes, which include instructions. The processor 110 executes the instructions stored in the internal memory 121 to execute various functional applications and data processing of the electronic device 100.
[0088] The electronic device 100 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0089] The audio module 170 is used to convert digital audio information into analog audio signals for output, and is also used to convert analog audio input into digital audio signals.
[0090] The speaker 170A, also called a "horn", is used to convert audio electrical signals into sound signals.
[0091] The receiver 170B, also called a "handset", is used to convert audio electrical signals into sound signals.
[0092] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals.
[0093] The headphone jack 170D is used to connect a wired headphone.
[0094] Among them, the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, an acceleration sensor 180E, a distance sensor 180F, a fingerprint sensor 180H, a touch sensor 180K, a bone conduction sensor 180M, etc.
[0095] The buttons 190 include a power button, a volume button, and the like.
[0096] Motor 191 can generate vibration prompts.
[0097] The indicator 192 may be an indicator light, which may be used to indicate the charging status, power level changes, messages, missed calls, notifications, etc.
[0098] The SIM card interface 195 is used to connect a SIM card.
[0099] Figure 2 is a block diagram of the software structure of electronic device 100 according to an embodiment of the present application. A layered architecture divides software into several layers, each with distinct roles and responsibilities. Layers communicate with each other via software interfaces. In some embodiments, the operating system is divided into four layers: the application layer, the application framework layer, the system library layer, and the kernel layer, from top to bottom. The application layer may include a series of application packages.
[0100] As shown in FIG2 , the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, wallet, etc.
[0101] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions.
[0102] As shown in FIG2 , the application framework layer may include a window manager, a content provider, a view system, a telephony manager, a resource manager, a notification manager, and the like.
[0103] The window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, take screenshots, etc.
[0104] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0105] The view system includes visual controls, such as those for displaying text and images. The view system is used to build applications. A display interface can consist of one or more views. For example, a display interface containing a text notification icon might include a view for displaying text and a view for displaying images.
[0106] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including answering, hanging up, etc.).
[0107] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0108] The Notification Manager allows applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically without user interaction. For example, the Notification Manager is used to notify users of completed downloads and message reminders. The Notification Manager can also display notifications in the top status bar of the system as icons or scrolling text, such as notifications from background applications, or as dialog windows on the screen. Examples include text messages in the status bar, beeps, vibrations on electronic devices, and flashing indicator lights.
[0109] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the core library.
[0110] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.
[0111] The system library can include multiple functional modules, such as a surface manager, media libraries, a 3D graphics processing library (such as OpenGL ES), and a 2D graphics engine (such as SGL).
[0112] The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.
[0113] The media library supports playback and recording of a variety of common audio and video formats, as well as static image files. The media library can support a variety of audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0114] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0115] A 2D graphics engine is a drawing engine for 2D drawings.
[0116] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver, and sensor driver.
[0117] Before introducing the technical solution of this application, some professional terms that may be involved in this application are first introduced as follows.
[0118] Thumbnail: In the embodiment of the present application, a thumbnail can be understood as a preview image in the gallery of an electronic device for users to quickly browse images. The size of a thumbnail is generally small, so that the electronic device can quickly display multiple thumbnails. In the embodiment of the present application, thumbnails can include presentations in multiple different views, such as a day view (or grid view), a month view, a year view, etc. The size of a thumbnail can be expressed as "pixel * pixel". For example, the size of a thumbnail in the day view can be 256*256; the size of a thumbnail in the month view can be 128*128; and the size of a thumbnail in the year view can be 64*64. Generally speaking, the size of a thumbnail in the day view is larger than the size of a thumbnail in the month view, and the size of a thumbnail in the month view is larger than the size of a thumbnail in the year view. In the embodiment of the present application, the thumbnail in the day view, the thumbnail in the month view, and the thumbnail in the year view can be referred to as "day thumbnail", "month thumbnail", and "year thumbnail" respectively.
[0119] For ease of description, the embodiment of the present application uses the electronic device displaying thumbnails in the day view as an example to illustrate the applicable scenarios of the embodiment of the present application, but this does not constitute a limitation on the applicable scenarios of the technical solutions provided by the embodiment of the present application.
[0120] For example, Figure 3 is a schematic diagram of a scenario to which the embodiments of the present application may be applied. The graphical user interface (GUI) in Figures 3 (a) and 3 (b) illustrates the process of the electronic device 200 displaying an image in response to a user's operation.
[0121] Referring to FIG. 3 (a), the GUI may be a display interface 210 of a gallery application on the electronic device 200. The display interface 210 may be used to display thumbnails of images in a day view. In the display interface 210, the thumbnails of the images in the day view are arranged in chronological order based on the time of day they were taken. For example, the display interface 210 displays thumbnails of images taken between December 14, 2023 and December 16, 2023 in the day view.
[0122] The electronic device 200 can switch and display thumbnails of pictures taken on different dates in the day view in response to a sliding operation of the user.
[0123] For example, after the electronic device 200 detects an upward sliding operation by the user on the display interface 210 , the GUI as shown in FIG. 3( b ) may be displayed.
[0124] 3( b ), the GUI may be a display interface 220 of a gallery application of the electronic device 200. The display interface 220 may be used to display thumbnails of pictures taken between November 13, 2023 and November 15, 2023 in a day view.
[0125] When an electronic device displays a day view, its display can display multiple daily thumbnails. For example, the electronic device's display can display 32 daily thumbnails at a time. As the user swipes within the display interface of the gallery application, the electronic device 200 continuously switches the displayed daily thumbnails. However, when the user swipes quickly, the daily thumbnails displayed on the electronic device may contain some white blocks, meaning that some daily thumbnails are not immediately displayed but are displayed after a period of time.
[0126] Continuing to refer to (b) in FIG3 , the daily thumbnails 221 , 222 , 223 and 224 in the display interface 220 are not displayed immediately, but are displayed as white blocks.
[0127] The reason for this phenomenon is that each daily thumbnail is stored in the Joint Photographic Experts Group (JPG) format in the electronic device. When the electronic device displays each daily thumbnail, it needs to decode each daily thumbnail separately. Therefore, when multiple daily thumbnails are displayed on one screen, the decoding time of the image is long, which easily causes the display of white blocks.
[0128] Similarly, when an electronic device displays a month view or a year view, the number of thumbnails displayed on one screen of the electronic device is greater, and as the user slides, it is more likely to cause the electronic device to display white blocks.
[0129] In view of this, embodiments of the present application provide a thumbnail display method and electronic device. In this technical solution, when displaying a target thumbnail, the electronic device can first display a thumbnail smaller than the target thumbnail. The electronic device then synchronously decodes the target thumbnail in the background and displays the target thumbnail after decoding. This technical solution is intended to enable the user to quickly and smoothly display the corresponding thumbnail when swiping to view the thumbnails of the image displayed by the electronic device, avoiding the phenomenon of displaying white blocks.
[0130] The following will introduce the technical solution of the display method provided in the embodiment of the present application in conjunction with Figures 4 to 11.
[0131] For example, Figure 4 is a schematic diagram of a system architecture provided by an embodiment of the present application. As shown in Figure 4, the electronic device may include at least a gallery application, a camera application, a media library, and a memory.
[0132] The media library may at least include a picture writing module, a picture acquiring module and a thumbnail cache generating module.
[0133] The memory can store the original image, metadata, and multi-level thumbnails of the picture. The multi-level thumbnails can be understood as thumbnails of different sizes, such as daily thumbnails, monthly thumbnails, and yearly thumbnails.
[0134] For example, when the electronic device detects that a user uses a camera to take a picture A, the picture writing module can write the picture A into the memory. For example, the picture writing module can write the original picture of picture A into the memory and write the metadata of picture A into the memory.
[0135] After image A is written, the thumbnail cache generation module can generate thumbnails of multiple sizes corresponding to image A and store the thumbnails of multiple sizes in the memory. For example, the thumbnail cache generation module can generate thumbnails of size 1, size 2, and size 3 corresponding to image A and store the thumbnails of size 1, size 2, and size 3 in the memory, with size 1 > size 2 > size 3. For example, size 1 can correspond to a daily thumbnail, size 2 can correspond to a monthly thumbnail, and size 3 can correspond to a yearly thumbnail.
[0136] It should be understood that for each picture taken by the camera, the thumbnail cache generation module can generate multiple thumbnails of different sizes. Alternatively, for each picture included in the gallery application, the thumbnail cache generation module can generate multiple thumbnails of different sizes.
[0137] In other examples, the thumbnail cache generation module may also generate a screen preview corresponding to picture A. The size of the screen preview is the same as the original size of picture A, but the storage space occupied by the screen preview is smaller than the storage space occupied by the original picture A.
[0138] It should be understood that the metadata of the picture A may include information such as the size, storage location, shooting time, and shooting parameters of the picture A.
[0139] In another example, for a video B captured by a user using a camera, the image writing module can also write the video B and metadata of the video B into the memory. After the video B is written, the thumbnail cache generation module can generate thumbnails of multiple sizes corresponding to the cover image of the video B and store the thumbnails of multiple sizes in the memory.
[0140] Generally, electronic devices store thumbnails of different sizes in JPG format. This format has good compression performance, so that the images occupy less space in the read-only memory. However, when the electronic device displays the thumbnails, it needs to decode the thumbnails. When the electronic device needs to display multiple thumbnails at one time, white blocks are likely to appear.
[0141] In an embodiment of the present application, for thumbnails of larger sizes (such as daily thumbnails), the electronic device may store them in a format with a higher coding compression ratio in the memory, while for thumbnails of smaller sizes (such as monthly thumbnails and yearly thumbnails), due to their smaller sizes, they may be stored in a format with a lower coding compression ratio or without the need for coding compression. Alternatively, for thumbnails of a size greater than or equal to a preset size, the electronic device may store them in a format with a higher coding compression ratio in the memory, while for other thumbnails of a size smaller than the preset size, the electronic device may store them in a format with a lower coding compression ratio or without the need for coding compression in the memory.
[0142] For example, for thumbnails with smaller sizes, the electronic device may store them in a format with a lower coding compression rate, such as texture; or, the electronic device may store them in a format that does not require coding compression, such as bitmap.
[0143] The reason why the electronic device stores smaller thumbnails in this way is that the smaller thumbnails are stored in the memory in the format of bitmaps or textures. After obtaining the data of this part of the thumbnail, the electronic device can directly display this part of the thumbnail without decoding, thereby improving the speed of displaying the thumbnail.
[0144] Although thumbnails stored in bitmap or texture formats do not require decoding when displayed, the electronic device still needs to read these thumbnails from storage into running memory. In other words, reading each thumbnail requires a data read operation by the electronic device. Therefore, when there are many thumbnails and the thumbnail storage locations are relatively scattered (or the disk is severely fragmented), the electronic device's reading performance will be affected, and white blocks may still appear when the user quickly browses these thumbnails.
[0145] To address this issue, the present invention provides a method for storing thumbnails that can continuously store thumbnails of different images. This allows an electronic device to continuously read a large number of thumbnails when reading thumbnails, thereby improving the reading performance of the electronic device and avoiding the phenomenon of displaying white blocks. The technical solution for continuously storing thumbnails in the present invention will be described below with reference to Figures 5-8.
[0146] See Figure 5, which is a schematic diagram of a file organization method provided by an embodiment of the present application. When an electronic device first creates a file for storing thumbnails, it allocates a preset size of contiguous storage space for the file. The files can correspond one-to-one with the size types of the thumbnails, with each file responsible for organizing and storing the data of thumbnails of the corresponding size.
[0147] For example, when a thumbnail of size 1 is first created, the electronic device may create file 1, which is used to store thumbnails of size 1; when a thumbnail of size 1 is subsequently added, the electronic device may store the added thumbnail in file 1. When a thumbnail of size 2 is first created, the electronic device may create file 2, which is used to store thumbnails of size 2; when a thumbnail of size 2 is subsequently added, the electronic device may store the added thumbnail in file 2.
[0148] It should be understood that the file being used to store thumbnails can be understood as the continuous storage space allocated by the electronic device to the file being used to store thumbnail data.
[0149] The electronic device can allocate the same storage space for thumbnails of the same size. Assuming size 2 is 128*128, the electronic device can allocate 32 kilobytes (KB) of storage space for each thumbnail of size 2. The continuous storage space allocated by the electronic device for file 2 can be N times 32KB, where N is a positive integer. For example, when N is 64, the storage space allocated by the electronic device for file 2 is a continuous 2 megabytes (MB).
[0150] It should be understood that the first time an electronic device creates a file for storing thumbnails, it may be when the electronic device is turned on for the first time; or, it may be when the electronic device takes a picture, video, or stores a picture, video, or animated image for the first time.
[0151] The file may have a file header and index information.
[0152] The file header can record key information such as the fixed length of the current thumbnail, the maximum supported file size, and the starting position of the file. The fixed length of the thumbnail can be used to indicate the fixed size of each thumbnail in the file, such as 32KB or 16KB; the maximum supported file size can be used to indicate the maximum storage space of the file, such as 2MB or 4MB; and the starting position of the file can be used to indicate the location of the first thumbnail stored in the file in the memory, such as address A.
[0153] The index information may include an index and information indicating whether the storage location corresponding to the index is occupied. The index information is used to record the allocation of thumbnails stored in the file and the available storage space in the file. The electronic device can use this index information to determine the occupancy of the file, such as where the thumbnails are stored in the file and which storage space is not occupied. Therefore, when it is necessary to continue storing thumbnails in the future, the electronic device can use this index information to determine the available storage locations in the file and store the data of the thumbnail to be stored in the available storage locations in the file.
[0154] Exemplarily, the indication information may be represented by "1" or "0", wherein "1" indicates that it is occupied and "0" indicates that it is not occupied.
[0155] For example, for "index 1, index 2, index 3, index 4, ..." in the index information, the corresponding indication information is "1100...", which can indicate "the storage space corresponding to index 1 and index 2 is occupied, and the storage space corresponding to index 3 and index 4 is not occupied, ..." It should be understood that each index can correspond to a fixed-size storage space.
[0156] The electronic device can store the thumbnail in the continuous storage space allocated for the file. When storing the thumbnail, the electronic device can determine which indexes correspond to available storage space by searching the index information of the file, and then store the thumbnail in the available storage space of the file. After the thumbnail is stored, the storage space is occupied, and the electronic device can modify the indication information corresponding to the storage space, for example, changing the indication information from "0" to "1". At the same time, the index corresponding to the thumbnail is returned to the user space to facilitate subsequent reading of the thumbnail.
[0157] In this way, the electronic device can store thumbnails continuously to avoid scattered storage of thumbnails, so that when thumbnails are subsequently read, the thumbnails can also be read continuously, thereby improving the performance of the electronic device in reading thumbnails.
[0158] It should be understood that the above index information is managed by the kernel, and the application is not aware of the kernel's allocation of thumbnail indexes. For example, for a gallery application, when an electronic device writes thumbnails to a memory, the gallery application is not aware of how the thumbnail indexes are allocated.
[0159] In this way, the application does not need to manage the index information of the thumbnails, and the application developer has less workload in developing the application.
[0160] In other examples, the index information may also be managed in the user state of the electronic device.
[0161] For example, a gallery application in an electronic device can establish a mapping relationship between thumbnails and indexes, that is, the index information is managed by the gallery application. Then, when the electronic device writes a thumbnail to the memory, it can determine the available storage space based on the index information in the gallery application, store the thumbnail in the available storage space, and record the storage location of the thumbnail in the index information.
[0162] For example, Figure 6 is a schematic diagram of a user-mode module provided by an embodiment of the present application. As shown in Figure 6, the user-mode module may include an index mapping submodule and an index allocation submodule.
[0163] Exemplarily, the user mode module may be a gallery application.
[0164] The index mapping submodule can be used to record the mapping relationship between the stored thumbnails and indexes. It should be understood that the mapping relationship can be stored in the memory.
[0165] The index allocation submodule may be used to record currently available indexes and may support allocating the next available index when storing a new thumbnail.
[0166] The index allocation submodule can also be used to mark released indexes. For example, when the electronic device deletes thumbnail X according to a user operation, the index allocation submodule can mark the index X corresponding to thumbnail X as released. The next time an index is allocated, the index X can be assigned to the next stored thumbnail.
[0167] It should be understood that the content recorded by the index allocation submodule can be stored in a memory.
[0168] In this case, the files stored in the memory can be shown in Figure 7. For example, Figure 7 is a schematic diagram of another file organization method provided by an embodiment of the present application. Referring to Figure 7, the files in the memory can include thumbnails stored continuously, and each thumbnail occupies the same storage space.
[0169] In this way, the index information of the thumbnail is managed by the user mode application, thereby eliminating the need for the kernel, making the storage of thumbnails more convenient. In addition, the storage of thumbnails does not require the kernel, allowing the application to support electronic devices under different systems and having good portability.
[0170] When the storage space of the file is full or about to be full, the electronic device continues to allocate another continuous storage space of a preset size for the file. Exemplarily, the another preset size may be M times the current preset size.
[0171] For example, referring to FIG8 , FIG8 is a schematic diagram of allocating a continuous storage space provided in an embodiment of the present application. When an electronic device allocates storage space for a file for the first time, it may allocate a continuous storage space of a preset size. For example, the index of the continuous storage space may be 1, 2, 3, ..., P, and the continuous storage space may store up to P thumbnails. When the continuous storage space is full, or when the continuous storage space is about to be full, the electronic device may continue to allocate another continuous storage space of a preset size for the file. For example, the index of the continuous storage space of another preset size may be K, K+1, K+2, ..., Q.
[0172] It should be understood that when the continuous storage space of another preset size is full or about to be full, the electronic device can continue to allocate a certain size of continuous storage space for the file. For example, the newly allocated continuous storage space can be M times the continuous storage space allocated last time.
[0173] For example, if a 2M continuous storage space is initially allocated to the file, then when the 2M continuous storage space is full or about to be full, the electronic device may continue to allocate a 4M continuous storage space for the file. The 2M storage space and the 4M storage space may be continuous or discontinuous.
[0174] It is understandable that fixed-size thumbnails, such as 32KB thumbnails, can be stored in the file. If a thumbnail is less than 32KB, the storage space occupied by the thumbnail can be padded with zeros when storing the thumbnail so that the storage space finally occupied by the thumbnail is 32KB.
[0175] In this way, electronic devices can store thumbnails of smaller sizes (such as year thumbnails and month thumbnails) continuously. Then, when the electronic device reads the thumbnails later, it can also be read continuously. As mentioned above, after the data is read, it can be displayed directly without decoding, thereby improving the reading performance of the electronic device and avoiding the phenomenon of displaying white blocks.
[0176] In other examples, the electronic device may also store the thumbnails in a non-relational database in a key-value format when storing the thumbnails, and read the thumbnails continuously as much as possible when reading the thumbnails to improve the data reading speed.
[0177] Larger thumbnails (such as daily thumbnails) can also be stored using the aforementioned file organization, or not. However, if electronic devices store larger thumbnails as bitmaps or textures, while decoding is not required for display, bitmaps or textures offer lower compression rates and consume more space in read-only memory. Furthermore, existing electronic devices typically store larger thumbnails in JPG format.
[0178] Therefore, for a larger thumbnail A, the embodiment of the present application can store it in a format with a high encoding compression ratio, such as JPG or portable network graphics (PNG). When displaying the larger thumbnail A, the electronic device can first obtain the corresponding smaller thumbnail B in the above manner and directly display it in the display area A of the gallery where thumbnail A was originally required to be displayed. At the same time, the electronic device obtains thumbnail A from the memory and decodes thumbnail A in the background. After the decoding is completed, thumbnail A is used to replace thumbnail B, so that the electronic device can display the larger thumbnail A in the display area A.
[0179] Continuing with FIG. 4 , in some embodiments, after the thumbnail cache generation module stores the data of the multi-level thumbnails of the aforementioned media files, such as pictures or videos, in a memory, when a user needs to view thumbnail A of the picture in the gallery, the picture acquisition module can obtain a thumbnail B of the same picture that is smaller than thumbnail A from the memory through the thumbnail acquisition interface, and display thumbnail B through the display unit in display area A where thumbnail A was originally intended to be displayed. Simultaneously, the picture acquisition module obtains thumbnail A from the memory through the thumbnail acquisition interface, and the electronic device decodes thumbnail A in the background. After decoding is complete, thumbnail A is used to replace thumbnail B, allowing the electronic device to display the larger thumbnail A in display area A.
[0180] In some embodiments, when a user needs to view thumbnail A of an image in a gallery, the image acquisition module can obtain a thumbnail B of the same image that is smaller than thumbnail A from the memory through the thumbnail acquisition interface, along with thumbnail A, and first display thumbnail B in display area A, where thumbnail A was originally intended to be displayed, through the display unit. Simultaneously, the electronic device decodes thumbnail A in the background, and after decoding is complete, replaces thumbnail B with thumbnail A, allowing the electronic device to display the larger thumbnail A in display area A.
[0181] For example, the thumbnail A may be a daily thumbnail, and the thumbnail B may be a weekly thumbnail, a monthly thumbnail, a yearly thumbnail, or other thumbnail smaller in size than the daily thumbnail.
[0182] It should be understood that the thumbnail B first displayed by the electronic device is enlarged to the same size as the thumbnail A and then displayed in the display area where the thumbnail A originally needs to be displayed.
[0183] In this way, for thumbnails with larger sizes, the present application can store them in formats with higher encoding compression rates such as JPG and PNG, which can make the memory space they occupy smaller. In addition, when displaying, the electronic device first displays thumbnails with smaller sizes that do not need to be decoded, and decodes the thumbnails with larger sizes in the background, and after decoding is completed, replaces the thumbnails with larger sizes. Since the thumbnails with smaller sizes are stored in a continuous storage manner and do not need to be decoded when displayed, the electronic device can read and display the thumbnails with smaller sizes faster, thereby avoiding the electronic device from displaying white blocks. After the decoding of the larger thumbnail is completed, the electronic device replaces the previously displayed thumbnail with the thumbnail with the larger size. The user cannot perceive this change, which can fully meet the user's needs for quickly browsing pictures.
[0184] In addition, for existing electronic devices, thumbnails of larger size are generally stored in JPG format, and this technical solution can also be applied to these electronic devices.
[0185] The technical solution for continuously storing thumbnails in an embodiment of the present application will be described in detail below with reference to FIG9 .
[0186] For example, FIG9 is a schematic flow chart of a method for continuously storing thumbnails provided by an embodiment of the present application. As shown in FIG9 , the method 300 may include steps 310 to 340 .
[0187] 310 , for a thumbnail of a target size, the electronic device creates a target file having a first target size.
[0188] For example, for a same photographed picture, the electronic device may store thumbnails of multiple sizes. For each thumbnail of different sizes, the electronic device may create a corresponding target file.
[0189] The thumbnail of the target size may be the smaller thumbnail mentioned above, such as a monthly thumbnail, a yearly thumbnail, etc. The thumbnail of the target size may also be the larger thumbnail mentioned above, such as a daily thumbnail, etc.
[0190] Exemplarily, if the target size is 256*256, the electronic device may create a target file 1 of a first target size, where the first target size may be N times the size of the storage space occupied by a thumbnail of the target size.
[0191] It can be understood that the target file may be an example of the file for storing thumbnails described in FIG. 5 and FIG. 8 above.
[0192] 320 , the electronic device writes the thumbnail into the continuous storage space of the target file according to the index information of the target file, wherein the electronic device allocates the same storage space for each thumbnail.
[0193] When a thumbnail needs to be written into the continuous storage space of a target file, the electronic device may write the thumbnail into the continuous storage space of the target file based on the index information of the target file. For example, the electronic device may first query the index information of the target file, determine the next available storage space in the target file, and write the thumbnail into the next available storage space.
[0194] For each thumbnail stored in the continuous storage space of the target file, the electronic device allocates a fixed amount of storage space for it. For example, the electronic device allocates 32KB of storage space for each thumbnail. If the size of the thumbnail is less than 32KB, the electronic device may pad the occupied storage space with zeros when storing the thumbnail, so that the final storage space allocated for the thumbnail is 32KB.
[0195] It is understood that after writing the thumbnail to the continuous storage space of the target file, the electronic device can modify the index indication information corresponding to the thumbnail in the index information of the target file, such as changing the indication information from "0" to "1". The index corresponding to the thumbnail is returned to the user space to facilitate subsequent reading of the thumbnail.
[0196] In this way, the electronic device can continuously store multiple thumbnails that need to be stored.
[0197] 330 , the electronic device determines whether the continuous storage space of the target file is full.
[0198] The electronic device can determine whether the target file is full based on the index information of the target file. For example, for index X, a value of 1 indicates that the file is full, and a value of 0 indicates that the file is not full.
[0199] In some examples, referring to FIG8 , when the electronic device writes a thumbnail to the target file, if it determines by querying the index information that the indication information of indexes 1 to P are all 1, it can be determined that the target file is full, and the electronic device can then execute step 340. Alternatively, when the electronic device determines that the target file is about to be full, it can also execute step 340.
[0200] In other examples, when the electronic device determines based on the index information that there is an index with indication information of 0, it can be determined that the target file is not full, and the electronic device can continue to execute step 320 and store the thumbnail in the target file when a thumbnail needs to be generated.
[0201] 340. The electronic device allocates a continuous storage space of a second target size for the target file.
[0202] When the electronic device determines that the target file is full, the electronic device may allocate contiguous storage space of a second target size for the target file. The second target size may be M times the first target size, where M is a positive integer. For example, M is 2 or 4. The specific value of M is not limited in the embodiments of the present application.
[0203] It should be understood that after step 340 , the electronic device may continue to execute step 320 when it is necessary to continue writing thumbnails.
[0204] In this way, the electronic device can continuously store thumbnails, so that when the electronic device displays multiple thumbnails later, the thumbnails can be continuously read, thereby improving the reading speed of thumbnails. The following will describe in detail the technical solution for electronic device reading thumbnails with reference to Figures 10-11.
[0205] For example, Figure 10 is a schematic flowchart of a method for reading thumbnails provided by an embodiment of the present application. As shown in Figure 10 , the method 400 can be applied to an electronic device, and the method 400 can include steps 410 to 430.
[0206] 410 , in response to the operation of causing the electronic device to display thumbnail 1 , the electronic device queries the index of thumbnail 1 .
[0207] Exemplarily, the thumbnail 1 may be a thumbnail smaller than a preset size. The thumbnail 1 may also be the thumbnail of smaller size described above. For example, the first target thumbnail is a monthly thumbnail or a yearly thumbnail.
[0208] In some embodiments, the operation of causing the electronic device to display thumbnail 1 may also be an operation in which the user swipes on display interface A of the gallery. For example, display interface A may be a display interface for displaying monthly thumbnails. When the electronic device detects a downward or upward swipe by the user on display interface A, the electronic device displays multiple thumbnails (e.g., 102) in response to the user's swipe operation. Each of the multiple thumbnails is thumbnail 1. The electronic device may then first query the index of thumbnail 1.
[0209] For example, at a certain moment, as the user slides, the electronic device needs to display multiple thumbnails. The electronic device needs to first obtain the information of the thumbnails to be displayed from the media library, such as the file name, creation date, uniform resource locator and index of the thumbnail.
[0210] 420 , the electronic device obtains thumbnail 1 according to the index of thumbnail 1 .
[0211] After the electronic device obtains the index of the thumbnail image 1 to be displayed, the thumbnail image 1 can be obtained from the memory according to the index. For example, in the electronic device, the thumbnail image 1 is stored in the format of a bitmap or texture.
[0212] It should be understood that the thumbnails 1 can be stored continuously using the storage method described above, so the electronic device continuously reads the data of the multiple thumbnails 1 according to the indexes of the multiple thumbnails 1, thereby improving the data reading speed.
[0213] 430 , the electronic device displays thumbnail 1 .
[0214] In some examples, when thumbnail 1 is stored in a bitmap format, since thumbnail 1 is not compressed during storage, the electronic device can directly display thumbnail 1 through a display unit after acquiring the bitmap format data of thumbnail 1 .
[0215] In some examples, when thumbnail 1 is stored in a texture format, after obtaining the texture format data of thumbnail 1, the electronic device can process the texture format data through the GPU and directly display the thumbnail 1 through the display unit.
[0216] It should be understood that in the above two methods, the electronic device does not need to decode the thumbnail 1 and can display it directly.
[0217] In this way, when displaying multiple thumbnails, the electronic device can read the multiple thumbnails continuously, thereby improving the data reading speed. In addition, the electronic device can directly display the data without decoding the data, thereby improving the speed of displaying thumbnails. The electronic device can quickly display the required thumbnails as the user slides, avoiding the display of white blocks.
[0218] In some cases, for larger thumbnails, such as daily thumbnails, where a user needs to quickly display multiple thumbnails while scrolling, for example, the electronic device needs to transmit 90 frames per second. To avoid displaying white blocks, the electronic device needs to first obtain a smaller thumbnail, enlarge it, and then display it within the display area of the larger thumbnail. This technical solution will be described below in conjunction with Figure 11.
[0219] For example, Figure 11 is a schematic flowchart of another method for reading thumbnails provided by an embodiment of the present application. As shown in Figure 11 , the method 500 can be applied to an electronic device, and the method 500 can include steps 510 to 540.
[0220] 510 , in response to an operation of causing the electronic device to display thumbnail 2 , query the index of thumbnail 2 and the index of thumbnail 3 , wherein the size of thumbnail 3 is smaller than the size of thumbnail 2 .
[0221] For example, thumbnail 2 may be a thumbnail with a size greater than or equal to a preset size, and thumbnail 3 may be a thumbnail of the same image with a size smaller than thumbnail 2. It should be understood that thumbnail 2 may be the larger thumbnail mentioned above, and thumbnail 3 may be the smaller thumbnail mentioned above.
[0222] For example, for picture A taken by an electronic device, thumbnail 2 is the daily thumbnail corresponding to picture A, and thumbnail 3 is the monthly thumbnail corresponding to picture A. It should be understood that thumbnail 3 can also be the weekly thumbnail or yearly thumbnail corresponding to picture A.
[0223] It should be understood that the manner in which the electronic device queries the index can be found in the relevant description in step 410, and for the sake of brevity, it will not be repeated here.
[0224] 520 , the electronic device obtains thumbnail 3 according to the index of thumbnail 3 , and obtains thumbnail 2 according to the index of thumbnail 2 .
[0225] It should be understood that the electronic device can obtain thumbnail 3 in a directly displayable bitmap or texture format based on the index of thumbnail 3. As mentioned above, since the larger thumbnail 2 is stored in the memory after encoding and compression, the electronic device obtains the encoded thumbnail 3 based on the index of thumbnail 2, which needs to be decoded before it can be displayed.
[0226] 530 , the electronic device displays thumbnail 3 in the display area of thumbnail 2 and decodes thumbnail 2.
[0227] After the electronic device obtains the thumbnail 3 in the bitmap or texture format, the thumbnail 3 can be directly displayed in the display area where the thumbnail 2 is originally required to be displayed.
[0228] For example, the size of thumbnail 2 is 256*256, and the size of thumbnail 3 is 128*128. The electronic device can enlarge the size of thumbnail 3 to 256*256 and display it in the display area where thumbnail 2 is originally required to be displayed, so that the user sees that the electronic device displays thumbnail 2.
[0229] It should be understood that while the electronic device displays the thumbnail 3 , the encoded thumbnail 2 can be decoded synchronously in the background.
[0230] 540 , after the thumbnail 2 is decoded, the electronic device replaces the thumbnail 3 with the thumbnail 2 .
[0231] After the decoding of thumbnail 2 is completed, the electronic device can display thumbnail 2 instead of thumbnail 3. Since the electronic device does not need to decode when displaying thumbnail 3, the electronic device can quickly display multiple thumbnails that need to be displayed as the user quickly slides.
[0232] In addition, after the electronic device decodes thumbnail 2, it will replace thumbnail 3 with thumbnail 2. This process takes a short time and the user can hardly perceive the change. To the user, the electronic device displays the larger thumbnail 2, which can provide the user with a good and fast browsing experience.
[0233] In some cases, because the user slides the pictures quickly, the electronic device needs to switch the multiple thumbnails displayed on the display screen as the user slides. It is possible that the multiple thumbnails 2 that were previously required to be displayed are still being decoded in the background while the user continues to slide, so that the electronic device does not need to display the multiple thumbnails 2, but needs to display another multiple thumbnails 2.
[0234] Therefore, the method 500 may further include:
[0235] When it is determined that the thumbnail 2 does not need to be displayed any more, the electronic device cancels decoding of the thumbnail 2 .
[0236] For example, since the display screen of an electronic device needs to display multiple thumbnails at one time, when multiple thumbnails 2 are decoded in the background of the electronic device, if there are still 10 thumbnails waiting to be decoded in the decoding queue, at this time, the user's sliding operation is detected and the electronic device needs to display other thumbnails, then the electronic device can cancel the decoding task of the 10 thumbnails and continue decoding the other thumbnails that need to be displayed.
[0237] In this way, the electronic device can give priority to decoding the thumbnail that currently needs to be displayed, thereby ensuring that the currently displayed picture has no white blocks. In addition, canceling decoding for the thumbnail that the user has slid away and does not need to be displayed can save power consumption of the electronic device.
[0238] It is understandable that the electronic device may also provide a variety of display strategies for the user to choose from. For example, the electronic device may provide a fast access strategy, a balanced access strategy, and a high-quality access strategy.
[0239] The method shown in FIG11 may be a balanced access strategy.
[0240] For example, in response to an operation instructing the electronic device to display thumbnail A1, the electronic device may obtain a thumbnail B1 that is smaller than thumbnail A1 and display thumbnail B1 in the display area of thumbnail A1. For example, thumbnail A1 may be a daily thumbnail, and thumbnail B1 may be a monthly thumbnail. Alternatively, thumbnail A1 may be the original image, and thumbnail B1 may be a daily thumbnail.
[0241] In this way, the electronic device can display pictures quickly.
[0242] For the high-quality access policy, in response to the operation of causing the electronic device to display the thumbnail A2, the electronic device may obtain data of the thumbnail A2 at the original size and display the thumbnail A2, thereby making the thumbnail A2 displayed by the electronic device clearer.
[0243] It is understandable that the user can choose which of the above-mentioned display strategies to use in the application.
[0244] In other examples, the electronic device may also determine a corresponding display strategy based on the user's sliding speed.
[0245] For example, when the electronic device determines that the user's sliding speed in the display interface of the gallery application is less than the preset speed, the electronic device obtains the thumbnail to be displayed and displays it after decoding is completed, which can meet the user's usage needs. The electronic device can then determine to take effect a high-quality access policy.
[0246] When an electronic device determines that a user's scrolling speed within the gallery application's display interface is greater than or equal to a preset speed, it may take a long time for the electronic device to retrieve the desired thumbnail and display it after decoding, resulting in white blocks being displayed. Therefore, the electronic device can determine the implementation of a balanced access policy to achieve faster thumbnail display and avoid the white block phenomenon.
[0247] FIG12 is a schematic flow chart of a thumbnail display method provided by an embodiment of the present application. As shown in FIG12 , the method 600 can be applied to an electronic device, and the method 600 can include steps 610 to 640.
[0248] 610. In response to a first operation of causing the electronic device to display a thumbnail of a target image, the electronic device obtains a first target thumbnail and a second target thumbnail, wherein the first target thumbnail and the second target thumbnail are thumbnails of different sizes of the target image, and the size of the first target thumbnail is larger than the size of the second target thumbnail.
[0249] It should be understood that the first target thumbnail may be the larger thumbnail mentioned above, such as the daily thumbnail; the second target thumbnail may be the smaller thumbnail mentioned above, such as the monthly thumbnail or the yearly thumbnail.
[0250] For example, the first operation may be an operation in which the user clicks on the gallery, and the size of the thumbnail of the target image displayed in the gallery is the same as the size of the first target thumbnail when the electronic device last exits the gallery. Alternatively, the first operation may be an operation in which the user swipes up or down in the gallery, and the size of the thumbnail of the target image displayed in the gallery is the same as the size of the first target thumbnail. Alternatively, the first operation may be an operation in which the user swipes with two fingers to enlarge the thumbnail when the size of the target image displayed in the gallery is the same as the size of the second target thumbnail.
[0251] 620. The electronic device displays a second target thumbnail in a display area for displaying thumbnails of target images.
[0252] The electronic device first displays the second target thumbnail in the display area for displaying the thumbnail of the target image. For example, the electronic device may first enlarge the size of the second target thumbnail to the same size as the first target thumbnail and then display it in the display area.
[0253] 630. The electronic device decodes the first target thumbnail.
[0254] It is understandable that step 620 and step 630 may be performed synchronously. Thus, while the electronic device displays the second target thumbnail, the electronic device synchronously decodes the first target thumbnail in the background.
[0255] 640 , after decoding of the first target thumbnail is completed, the electronic device uses the first target thumbnail to replace the second target thumbnail in the display area.
[0256] After the first target thumbnail is decoded, the electronic device replaces the second target thumbnail in the display area with the first target thumbnail, so that the first target thumbnail with a larger size is displayed in the display area.
[0257] In this way, the electronic device can quickly read and display the smaller thumbnail, thus avoiding the display of white blocks. After the larger thumbnail is decoded, the electronic device replaces the previously displayed smaller thumbnail with the larger thumbnail. The user will not notice this change, which fully meets the user's need for fast image browsing.
[0258] Based on an embodiment of the present application, in response to a first operation that causes an electronic device to display a thumbnail of a target image, the electronic device can obtain a first target thumbnail with a larger size and a second target thumbnail with a smaller size of the target image, and display the second target thumbnail with a smaller size in a display area for implementing the thumbnail of the target image; and decode the first target thumbnail in the background, and after the decoding of the first target thumbnail is completed, use the first target thumbnail to replace the second target thumbnail in the display area.
[0259] In this way, when displaying the thumbnail of the target image, the electronic device can first display the smaller thumbnail. The electronic device reads the smaller thumbnail faster, thereby improving the speed at which the electronic device displays thumbnails and avoiding the phenomenon of displaying white blocks when displaying multiple thumbnails at one time.
[0260] In some embodiments, when the electronic device stores a first target thumbnail and a second target thumbnail, the encoding compression rate of the first target thumbnail is greater than the encoding compression rate of the second target thumbnail; or, the first target thumbnail is stored in a format that requires encoding compression, and the second target thumbnail is stored in a format that does not require encoding compression.
[0261] For example, the first target thumbnail has a higher encoding compression ratio, for example, the first target thumbnail may be stored in JPG or PNG format. The second target thumbnail has a lower encoding compression ratio, for example, the second target thumbnail may be stored in a texture format. Alternatively, the second target thumbnail may be stored in a format that does not require encoding compression, for example, the second target thumbnail may be stored in a bitmap format.
[0262] It should be understood that the storage format that does not require coding compression can also be understood as a storage format with a coding compression rate of 0.
[0263] Based on the embodiment of the present application, the encoding compression rate of the first target thumbnail is greater than the encoding compression rate of the second target thumbnail, or the first target thumbnail is stored in a format that requires encoding compression, and the second target thumbnail is stored in a format that does not require encoding compression.
[0264] In this way, the electronic device can quickly display the second target thumbnail, thereby avoiding the phenomenon of displaying a white block.
[0265] In some embodiments, in response to a first operation causing the electronic device to display a thumbnail of a target picture, obtaining a first target thumbnail and a second target thumbnail includes:
[0266] In response to the first operation, the electronic device obtains an index of the first target thumbnail and an index of the second target thumbnail;
[0267] The electronic device obtains the first target thumbnail and the second target thumbnail according to the index of the first target thumbnail and the index of the second target thumbnail.
[0268] It should be understood that the manner in which the electronic device obtains the index of the first target thumbnail and the index of the second target thumbnail can be found in the relevant description of step 410 above, and for the sake of brevity, it will not be repeated here.
[0269] It should be understood that the manner in which the electronic device obtains the first target thumbnail and the second target thumbnail can refer to the relevant description of step 420 above.
[0270] Based on the embodiment of the present application, the electronic device can obtain the first target thumbnail according to the index of the first target thumbnail, and obtain the second target thumbnail according to the index of the second target thumbnail, so that the electronic device can quickly obtain the thumbnails.
[0271] In some embodiments, before responding to the first operation, the method 600 may further include:
[0272] For the thumbnail of the target size, the electronic device creates a target file for storing the thumbnail of the target size, wherein the target file has a continuous storage space of a first target size;
[0273] When storing the thumbnail of the target size, the electronic device writes the thumbnail of the target size into the continuous storage space of the target file according to the index information of the target file.
[0274] It should be understood that the target file may be the file for storing thumbnails described in FIG. 5 above.
[0275] 8 , the first target size may be the preset size in FIG8 , for example, the size of the storage space corresponding to index 1 to index P.
[0276] Continuing to refer to FIG. 8 , when storing thumbnails, the electronic device may write the thumbnails into a continuous storage space of the target file according to the index.
[0277] Based on the embodiment of the present application, for a thumbnail of a target size, the electronic device can be used to store a target file of the thumbnail, which has a continuous storage space. When storing a thumbnail of a target size, the electronic device stores it in the continuous storage space of the target file.
[0278] In this way, when the electronic device stores multiple thumbnails, it can achieve continuous storage of the thumbnails, avoiding scattered storage of the multiple thumbnails, so that when the thumbnails need to be read later, the thumbnails can be read continuously, thereby improving the speed of reading thumbnails.
[0279] In some embodiments, the electronic device writes a thumbnail of a target size into a continuous storage space of the target file according to the index information of the target file, including:
[0280] The electronic device determines the next available storage space in the continuous storage space according to the index information;
[0281] The electronic device writes the thumbnail of the target size into the next available storage space.
[0282] For example, referring to Figure 8, assuming that the storage space corresponding to index 1 to index 7 in the current target file is occupied, when there is a new thumbnail, the electronic device can determine through the index information that the next available storage space is the storage space corresponding to index 8, then the electronic device can store the new thumbnail in the storage space corresponding to index 8.
[0283] Based on the embodiment of the present application, the target file may have index information, so that when the electronic device stores thumbnails, it can query the next available storage space through the index information and store the thumbnail in the next available storage space, thereby realizing continuous storage of thumbnails.
[0284] In some embodiments, the electronic device allocates the same storage space for thumbnails of the same target size.
[0285] For example, referring to Figure 8, the storage space corresponding to each index is the same. In this way, when the electronic device stores thumbnails, the rule is relatively simple, and the thumbnails only need to be written into a storage space of a fixed size.
[0286] Based on the embodiment of the present application, the electronic device allocates the same storage space for thumbnails of the same target size, which can improve the performance of the electronic device in reading thumbnails.
[0287] In some embodiments, the method 600 may further include:
[0288] When the continuous storage space of the target file is full, the electronic device allocates a continuous storage space of a second target size to the target file.
[0289] Exemplarily, the second target size may be M times the first target size, where M is a positive integer.
[0290] It should be understood that the continuous storage space of the first target size and the continuous storage space of the second target size may be continuous or discontinuous.
[0291] For example, referring to Figure 8, when the continuous storage space of the first target size is full, the electronic device can continue to allocate continuous storage space of the second target size to it, such as the indexes corresponding to the continuous storage space of the first target size are index 1 to index P, and the indexes corresponding to the continuous storage space of the second target size are index K to index Q.
[0292] Based on the embodiment of the present application, when the continuous storage space of the target file is full, the electronic device continues to allocate continuous storage space of a second target size for the target file, so that subsequently stored thumbnails can also be stored continuously.
[0293] In some embodiments, the storage format of the second target thumbnail includes a bitmap or a texture.
[0294] It is understandable that the storage format of the second target thumbnail may also include other storage formats with lower encoding compression rates, or other storage formats that do not require encoding compression.
[0295] Based on the embodiment of the present application, the storage format of the second target thumbnail includes a bitmap or texture, so that the electronic device does not need to decode when displaying the second target thumbnail, thereby increasing the speed at which the electronic device displays thumbnails and avoiding the phenomenon of displaying white blocks.
[0296] In some embodiments, the first operation is an operation for triggering the electronic device to display a thumbnail of a first target size, the first target size is the size of the first target thumbnail, and the method 600 further includes:
[0297] In response to a second operation for causing the electronic device to display a thumbnail of the target image, the electronic device obtains a second target thumbnail, wherein the second operation is an operation for triggering the electronic device to display a thumbnail of a second target size, the second target size being a size of the second target thumbnail, and the second target size being smaller than the first target size;
[0298] The electronic device displays the second target thumbnail in the display area.
[0299] For example, the first target size may be 256*256, and the second target size may be 128*128 or 64*64, etc.
[0300] For example, the second operation may be an operation in which the user clicks on the gallery, and the size of the thumbnail of the target image displayed in the gallery is the same as the size of the second target thumbnail when the electronic device last exits the gallery. Alternatively, the second operation may be an operation in which the user swipes up or down in the gallery, and the size of the thumbnail of the target image displayed in the gallery is the same as the size of the second target thumbnail. Alternatively, the second operation may be an operation in which the user swipes with two fingers to reduce the size of the thumbnail displayed in the gallery when the thumbnail is of the first target size.
[0301] Based on the embodiment of the present application, in response to the second operation that causes the electronic device to display a thumbnail of the second target size, the electronic device can obtain the second target thumbnail and directly display the second target thumbnail. This can improve the speed of the electronic device displaying thumbnails and avoid displaying white blocks.
[0302] In some embodiments, the method 600 further includes:
[0303] In a case where the decoding of the first target thumbnail is not completed and it is determined that the first target thumbnail does not need to be displayed further, the decoding operation on the first target thumbnail is canceled.
[0304] According to an embodiment of the present application, if the decoding of the first target thumbnail is not complete and the electronic device determines that it does not need to continue displaying the first target thumbnail, the decoding operation on the first target thumbnail is canceled. This technical solution can avoid decoding the first target thumbnail when it is not needed to be displayed, thereby saving power consumption of the electronic device.
[0305] In some embodiments, the electronic device determines that it is not necessary to continue displaying the first target thumbnail, including:
[0306] When the electronic device no longer displays the display area, the electronic device determines that it is not necessary to continue displaying the first target thumbnail.
[0307] The electronic device no longer displays the display area, which may include the electronic device needing to display other thumbnails following the user's sliding operation; or the electronic device responding to the user's operation of exiting the gallery, etc.
[0308] Based on the embodiment of the present application, the electronic device can determine whether it needs to continue displaying the first target thumbnail.
[0309] Figure 13 is a schematic block diagram of an electronic device provided in an embodiment of the present application. As shown in Figure 13, the electronic device 700 may include one or more processors 710; one or more memories 720; the one or more memories 720 store one or more instructions, which, when executed by the one or more processors 710, enable the thumbnail display method described in any of the possible implementations described above to be executed.
[0310] Illustratively, the electronic device 700 may be the electronic device 100 described above, the electronic device in FIG. 4 , or the like.
[0311] The electronic device 700 can be used to execute the above-mentioned method 300, method 400, method 500 and method 600, etc.
[0312] An embodiment of the present application also provides a device including a processor and a communication interface, the communication interface being used to receive a signal and transmit the signal to the processor, the processor processing the signal so that the thumbnail display method described in any possible implementation method described above is executed.
[0313] The device may be a chip. For example, the chip may be a chip system or an independent chip.
[0314] An embodiment of the present application also provides a readable storage medium, which stores instructions. When the instructions are executed on an electronic device, the electronic device executes the above-mentioned related method steps to implement the thumbnail display method in the above-mentioned embodiment.
[0315] An embodiment of the present application further provides a program product. When the program product is run on an electronic device, the electronic device executes the above-mentioned related steps to implement the thumbnail display method in the above-mentioned embodiment.
[0316] An embodiment of the present application further provides a thumbnail display device, comprising a module for implementing the thumbnail display method as described in any of the above embodiments.
[0317] In addition, an embodiment of the present application also provides a device, which can specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store instructions, and when the device is running, the processor can execute the instructions stored in the memory to enable the device to execute the thumbnail display method in the above-mentioned method embodiments.
[0318] Among them, the equipment, readable storage medium, program product or device provided in this embodiment is used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, and will not be repeated here.
[0319] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0320] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0321] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0322] The units described as separate components may or may not be physically separate, and 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 these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0323] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0324] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory, a random access memory, a magnetic disk, or an optical disk.
[0325] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A thumbnail display method, characterized in that, The method is applied to an electronic device, and the method includes: In response to a first operation for causing the electronic device to display a thumbnail of a target picture, obtaining a first target thumbnail and a second target thumbnail, where the first target thumbnail and the second target thumbnail are thumbnails of different sizes of the target picture, and the size of the first target thumbnail is larger than the size of the second target thumbnail; Displaying the second target thumbnail in a display area for displaying the thumbnail of the target picture; Decoding the first target thumbnail; After the decoding of the first target thumbnail is completed, using the first target thumbnail to replace the second target thumbnail in the display area.
2. The method according to claim 1, characterized in that, When the electronic device stores the first target thumbnail and the second target thumbnail, the coding compression ratio of the first target thumbnail is greater than the coding compression ratio of the second target thumbnail; Alternatively, the first target thumbnail is stored in a format that requires coding compression, and the second target thumbnail is stored in a format that does not require coding compression.
3. The method according to claim 1 or 2, characterized in that, The obtaining the first target thumbnail and the second target thumbnail in response to the first operation for causing the electronic device to display a thumbnail of a target picture includes: In response to the first operation, obtaining an index of the first target thumbnail and an index of the second target thumbnail; Obtaining the first target thumbnail and the second target thumbnail according to the index of the first target thumbnail and the index of the second target thumbnail.
4. The method according to any one of claims 1-3, characterized in that, Before responding to the first operation, the method further includes: For a thumbnail of a target size, creating a target file for storing the thumbnail of the target size, where the target file has a continuous storage space of a first target size; When storing the thumbnail of the target size, writing the thumbnail of the target size into the continuous storage space of the target file according to the index information of the target file.
5. The method according to claim 4, characterized in that, The writing the thumbnail of the target size into the continuous storage space of the target file according to the index information of the target file includes: Determining a next available storage space in the continuous storage space according to the index information; Writing the thumbnail of the target size into the next available storage space.
6. The method according to claim 5, wherein The electronic device allocates the same storage space for thumbnails of the same target size.
7. The method according to any one of claims 4-6, characterized in that The method further includes: When the continuous storage space of the target file is full, allocating a continuous storage space of a second target size for the target file.
8. The method according to any one of claims 1-7, characterized in that The storage format of the second target thumbnail includes a bitmap or a texture.
9. The method according to any one of claims 1-8, characterized in that, The first operation is an operation for triggering the electronic device to display a thumbnail of a first target size, and the first target size is the size of the first target thumbnail. The method further includes: In response to a second operation for causing the electronic device to display a thumbnail of a target picture, obtaining the second target thumbnail, where the second operation is an operation for triggering the electronic device to display a thumbnail of a second target size, the second target size is the size of the second target thumbnail, and the second target size is smaller than the first target size; Display the second target thumbnail within the display area.
10. The method according to any one of claims 1-9, characterized in that, The method further includes: When it is determined that there is no need to continue displaying the first target thumbnail while the decoding of the first target thumbnail is not completed, cancel the decoding operation performed on the first target thumbnail.
11. The method according to claim 10, wherein The determination of not needing to continue displaying the first target thumbnail includes: When the electronic device no longer displays the display area, determine that there is no need to continue displaying the first target thumbnail.
12. An electronic device, characterized in that, Includes: One or more processors; One or more memories; the one or more memories store one or more programs, and when the one or more programs are executed by the one or more processors, the thumbnail display method according to any one of claims 1-11 is executed.
13. A chip, characterized in that, The chip includes a processor and a communication interface. The communication interface is configured to receive a signal and transmit the signal to the processor, and the processor processes the signal such that the thumbnail display method according to any one of claims 1-11 is executed.
14. A readable storage medium, characterized in that, Instructions are stored in the readable storage medium, and when the instructions run on an electronic device, the thumbnail display method according to any one of claims 1-11 is executed.
15. A program product, characterized in that, The program product includes program code, and when the program code runs on an electronic device, the thumbnail display method according to any one of claims 1-11 is executed.