Application image management method, device, equipment and storage medium
By extracting 2x screen and 3x screen pictures and storing them according to the type, the problem of large proportion of picture files in the prior art is solved, and the installation package size is reduced and the optimization effect is maintained.
Patent Information
- Application Number
- CN201910661640.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-07-22
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2039-07-22
AI Technical Summary
In the prior art, when managing the image files in the installation package of an application, the proportion of image files cannot be effectively reduced, resulting in an increase in the size of the installation package.
By extracting 2x screen and 3x screen pictures as target pictures, the pictures in the picture collection file are divided into different types and stored in different ways according to the type, such as using PNG or JPG formats and using App Thinning for optimization processing.
It effectively reduces the proportion of image files in the application installation package, reduces the size of the installation package, and avoids invalid optimization during Xcode recompression.
Smart Images

Figure CN111767417B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of terminal technology, and in particular to a management method, device, equipment and storage medium for application pictures. Background Art
[0002] With the development of terminal technology, more and more applications (APPs) can be loaded into terminals. The installation package version of the application will be continuously updated. Each time the version is updated, new image files will be added to the installation package of the application, and the increasing image files will increase the size of the installation package of the application.
[0003] Currently, the images in the application are generally placed in the Asset Catalog, and then the application installation package is optimized through the AppThinning function to reduce the size of the installation package.
[0004] However, when compiling and packaging, Xocde will recompress the PNG images in the Asset Catalog, thereby adding back the metadata that has been deleted from the PNG images during the lossless compression process. This image management method will greatly reduce the effect of image compression, making image files occupy a larger proportion in the application installation package. Summary of the invention
[0005] The present invention provides an application image management method, device, equipment and storage medium, which can effectively manage image files in the installation package of the application, reduce the proportion of image files in the installation package of the application, and reduce the size of the installation package of the application.
[0006] In a first aspect, an embodiment of the present invention provides a method for managing application images, including:
[0007] If there are pictures that are not downloaded through the network in the installation package of the application, the pictures that are not downloaded through the network are used as the pictures to be selected;
[0008] Loading the selected pictures into an image resource management tool to obtain a picture set file of an initial installation package;
[0009] Extracting a first target picture and a second target picture from the picture set file;
[0010] Classifying the pictures of the picture set file into different types according to the first target picture and the second target picture;
[0011] The pictures in the picture set file are stored in different ways according to the picture type.
[0012] In a possible design, extracting the first target picture and the second target picture from the picture set file includes:
[0013] A 2x screen image is extracted from the image set file as the first target image, and a 3x screen image is extracted as the second target image.
[0014] In a possible design, according to the first target picture and the second target picture, the pictures of the picture set file are divided into different types, including:
[0015] Determining a critical value for dividing a picture according to the first target picture and the second target picture;
[0016] According to the critical value, the pictures in the picture set file are divided into a first category of pictures and a second category of pictures.
[0017] In a possible design, the pictures in the picture set file are stored in different ways according to the picture type, including:
[0018] Taking the first type of pictures from the picture file set, and determining whether to use the alpha channel to perform picture format conversion;
[0019] If an alpha channel is used, the first type of image is stored in the Bundle in PNG format;
[0020] If the alpha channel is not used, the first type of pictures are stored in the Bundle in JPG format.
[0021] In a possible design, the pictures in the picture set file are stored in different ways according to the picture type, including:
[0022] The second category of images are retained in the image file set and optimized using AppThinning.
[0023] In one possible design, it also includes:
[0024] If there are pictures downloaded from the network in the installation package of the application, the pictures downloaded from the network are uploaded to the picture library of the server, and the corresponding picture download link is saved in the installation package of the application.
[0025] In one possible design, it also includes:
[0026] Use a visualization tool to perform any one or more operations of adding, deleting, recompressing, and searching for images on the image files in the installation package of the application.
[0027] In a second aspect, an embodiment of the present invention provides a management device for application images, including:
[0028] A pre-selection module, used for, when there are pictures not downloaded through the network in the installation package of the application, taking the pictures not downloaded through the network as pictures to be selected;
[0029] A loading module, used to load the selected pictures into an image resource management tool to obtain a picture set file of an initial installation package;
[0030] An extraction module, used to extract a first target image and a second target image from the image set file;
[0031] a classification module, configured to classify the pictures of the picture set file into different types according to the first target picture and the second target picture;
[0032] The storage module is used to store the pictures in the picture set file in different ways according to the picture type.
[0033] In a possible design, the extraction module is specifically used to:
[0034] A 2x screen image is extracted from the image set file as the first target image, and a 3x screen image is extracted as the second target image.
[0035] In a possible design, the partitioning module is specifically used to:
[0036] Determining a critical value for dividing a picture according to the first target picture and the second target picture;
[0037] According to the critical value, the pictures in the picture set file are divided into a first category of pictures and a second category of pictures.
[0038] In a possible design, the storage module is specifically used for:
[0039] Taking the first type of pictures from the picture file set, and determining whether to use the alpha channel to perform picture format conversion;
[0040] If an alpha channel is used, the first type of image is stored in the Bundle in PNG format;
[0041] If the alpha channel is not used, the first type of pictures are stored in the Bundle in JPG format.
[0042] In a possible design, the storage module is specifically used for:
[0043] The second category of images are retained in the image file set and optimized using AppThinning.
[0044] In a possible design, it also includes: an upload module, which is used to upload the pictures downloaded from the network to the picture library of the server when there are pictures downloaded from the network in the installation package of the application, and save the corresponding picture download link in the application installation package.
[0045] In a possible design, it also includes: an editing module, which is used to perform any one or more operations including adding pictures, deleting pictures, recompressing pictures, and searching pictures on the picture files in the installation package of the application through a visual tool.
[0046] In a third aspect, an embodiment of the present invention provides an application image management device, comprising: a memory and a processor, wherein the memory stores executable instructions of the processor; wherein the processor is configured to execute the application image management method described in any one of the first aspects by executing the executable instructions.
[0047] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for managing application images described in any one of the first aspects.
[0048] In a fifth aspect, an embodiment of the present invention provides a program product, comprising: a computer program, wherein the computer program is stored in a readable storage medium, and at least one processor of a server can read the computer program from the readable storage medium, and the at least one processor executes the computer program so that the server executes any method for managing application images described in the first aspect.
[0049] The present invention provides a method, device, equipment and storage medium for managing application pictures. If there are pictures not downloaded through the network in the installation package of the application, the pictures not downloaded through the network are used as candidate pictures; the candidate pictures are loaded into an image resource management tool to obtain a picture set file of the initial installation package; a first target picture and a second target picture are extracted from the picture set file; pictures in the picture set file are divided into different types according to the first target picture and the second target picture; pictures in the picture set file are stored in different ways according to the picture type. The present invention can effectively manage the picture files in the installation package of the application, reduce the proportion of the picture files in the installation package of the application, and reduce the size of the installation package of the application. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1This is a schematic diagram of the principle of an application scenario of the present invention;
[0051] Figure 2 A flowchart of a method for managing application images provided in Embodiment 1 of the present invention;
[0052] Figure 3 A flowchart of a method for managing application images provided in Embodiment 2 of the present invention;
[0053] Figure 4 A schematic diagram of a flow chart of a visualization tool provided by an embodiment of the present invention;
[0054] Figure 5 A schematic diagram of the structure of an application image management device provided in Embodiment 3 of the present invention;
[0055] Figure 6 A schematic diagram of the structure of an application image management device provided in Embodiment 4 of the present invention;
[0056] Figure 7 A schematic diagram of the structure of an application image management device provided in Embodiment 5 of the present invention. DETAILED DESCRIPTION
[0057] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0058] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein, for example. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0059] The technical solution of the present invention is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0060] Below, some terms in this application are explained to facilitate understanding by those skilled in the art:
[0061] 1) iOS: an operating system developed by Apple for its mobile devices;
[0062] 2) App: short for Application, an application on a mobile phone.
[0063] 3) Xcode: It is an integrated development environment provided by Apple to developers for developing applications for macOS, iOS, WatchOS, and tvOS.
[0064] 4) App Thinning: App store and operating system perform a series of optimizations when installing iOS or watchOS apps to reduce the size of the installation package as much as possible, so that the app can be installed on the user's device with the smallest and most appropriate size. This process includes three steps: slicing, bitcode, and on-demand resources.
[0065] 5) Asset Catalog: It is an image resource management tool launched by iOS7, which provides great convenience for developers. It can display and support multiple image formats, which is convenient for setting App icons and startup page images, and it is concise to display images of different resolutions, which is very popular among developers.
[0066] 6)Assets.car: It is a collection of images stored in the Asset Catalog.
[0067] 7) Module: A reusable object that can interact with other objects. It is presented here in the form of a static Framework. Due to the diversity of functional businesses, components can be divided into basic components that provide basic capabilities and public capabilities, such as network requests, data parsing, etc.; business components developed for business needs complete the development of needs by relying on one or more basic components.
[0068] 8) PNG: (Portable Network Graphics) is a lossless compressed bitmap graphic format that supports index, grayscale, RGB color schemes and alpha channel features. The development goal of PNG is to improve and replace GIF as a format suitable for network transmission without patent license, so it is widely used on the Internet and other aspects.
[0069] 9) CgBI: is Apple's proprietary extension to the PNG image format.
[0070] 10)JPEG: (Joint Photographic Experts Group) is a widely used lossy compression standard method for photographic images.
[0071] With the development of terminal technology, more and more applications (Appliction, APP) can be loaded in the terminal. Images as resource files have become an indispensable part of an App installation package. The installation package version of the application will be continuously updated. Each time the version is updated, new image files will be added to the installation package of the application, and the increasing image files will increase the size of the installation package of the application. At present, the images in the application are generally placed in the AssetCatalog, and then the installation package of the application is optimized through the App Thinning function to reduce the size of the installation package. Put the image into the Asset Catalogs as an image Set Type with an extension of .imageset. The supported image formats are HEIF, .png, .jpg, and .pdf. In the imageSet, 2x and 3x images can be placed for the current 2x and 3x screens. AppThinning support was introduced after iOS 9. Select the target in Xcode and use AssetCatalog to provide multi-resolution image resources. Upload the packaged App to iTunes Connect. The App Store will create different "App variables" for the uploaded App archive. The App variable settings can be set in Xcode. After Slicing, the App has been split according to the resolution and CPU architecture of the current device, and only the resource files required by the current device will be sent. If the minimum supported version of the App is iOS9 or later, On-Demand Resources can also be used. To use App Thinning, the image must be placed in the Asset Catalog to take effect. Apple has almost created a perfect way to manage images. In order to obtain smaller images, this part is usually losslessly compressed, and the size of the image is reduced by deleting useless metadata in the PNG image. Through testing, lossless compression can generally be optimized by 25% to 30%, and appropriate lossy compression can continue to optimize to about 70%. However, when compiling and packaging, Xocde will re-compress the PNG images in the Asset Catalog, thereby adding back the metadata that has been deleted from the PNG image during the lossless compression process, and converting the PNG format into Apple's unique CgBI image format. This processing is to ensure that the CPU and GPU speed of Apple's underlying decoding framework is the fastest when decoding images. The effect of lossless compression just mentioned is invalid. At the same time, designers generally use tools to perform lossless compression on the cut images before cutting them for R&D. After R&D receives the cut images, they will perform lossy compression to optimize the package size, while ensuring that the cut images are acceptable to the designers.Then, by comparing the image size of the local project and the size of the image in Assets.car in the installation package, the image in Assets.car is 2.5 to 3.5 times the size of the local image. The data was obtained by sampling 100 images, which may have different lossy compression algorithms and different color spaces of the images, but it is an indisputable fact that the files in Assets.car are indeed larger than those in the local project. In summary, putting images in the Asset Catalog cannot effectively use lossless compression to optimize images. Often, designers and developers will have the illusion that the images have been optimized, but they do not know that it is an invalid or discounted optimization, which makes the image files occupy a large proportion in the installation package of the application.
[0072] In response to the above technical problems, the present invention provides an application image management method, device, equipment and storage medium, which can effectively manage the image files in the application's installation package, reduce the proportion of image files in the application's installation package, and reduce the size of the application's installation package. Figure 1 It is a schematic diagram of the principle of an application scenario of the present invention, such as Figure 1As shown, according to the scenario in which the picture is used, pictures that can be downloaded through the network and pictures that cannot be downloaded through the network can be divided. The classification of pictures depends on the user experience, and the use of network download depends on the user group that the App specifically targets. For pictures that can be downloaded through the network, only one network link address needs to be stored in the installation package. Therefore, these pictures are uploaded to the image library of the server, and the corresponding picture download link is saved in the application installation package. For pictures that cannot be downloaded using the network, the pictures need to be placed in the installation package of the application, which will be the pictures that need to be processed in the subsequent steps of this embodiment. These pictures are called selected pictures. An App can be divided into many modules according to different businesses, and each module can create an Asset Catalog file with an xcassets suffix separately to store the selected pictures. Then, all the selected pictures are put into the Asset Catalog. In order to avoid conflicts between the modules when Xcode compiles and merges the AssetCatalog, the added selected pictures need to be prefixed. When all the selected images are put into the Asset Catalog, the installation package with the .ipa suffix is output. The installation package here is not uploaded to the App Store, so it will not be optimized by App Thinning's slicing. Get the Assets.car file. Assets.car is a collection of images that are merged when all the images put into the Asset Catalog are compiled in Xcode. Then, simulate the implementation of AppThinning's Slicing, split the images used for the 2x screen and 3x screen in Assets.car and calculate the total size of the images. Each image put into the Asset Catalog will be put into an image set with 2x and 3x, and a Content.json file will be generated to manage the images. By analyzing Content.json, the size of the local project for the 2x and 3x screen phones in the local project can be obtained. According to the above steps, the sum of the size of the local images and the images actually installed by the user is obtained. A critical value can be divided according to the different image composition and image color space of each App, or a critical value for division can be set manually. According to the critical value, the images in the image set file are divided into the first category and the second category. The first type of images refers to images that require large file storage space. These images account for a small proportion of the total number of images, but a large proportion of the total size, and cannot be directly placed in the Asset Catalog. The second type of images refers to images that require small file storage space. These images account for a large proportion of the total number of images, but a small proportion of the total size, and these images continue to be placed in the Assets Catalog. App Thinning Slicing can be used for distribution.Because these images are very small, even if they are affected by Xcode's recompression, the proportion of the overall App package size does not increase (compared to the first category of images). The critical value can be set manually according to the file size, or it can be set by 2x under-screen comparison. Specifically, the total size of the optimized image = the total size of the local large image (the 3x image used) + the total size of the small and medium images in Assets.car. Let the total size of the optimized image be the minimum, which is the critical value for dividing the first and second categories of images. For the first category of images, if the alpha channel is not used to convert to JPG image format, the compression ratio of the image will be higher and put into the Bundle. If the alpha channel is used, continue to use the PNG image format and put it into the Bundle. And only 3x images are retained for this part of the images for use. In this way, after optimization, the already losslessly compressed images will not be affected by Xcode's recompression, and the optimization purpose will be achieved. For the second type of images, continue to put them in the Assets Catalog and use App ThinningSlicing distribution, because these images are very small in themselves, and even if they are affected by Xcode's recompression and increase in size, the proportion of the images in the overall App package size does not increase.
[0073] The above method can be applied to effectively manage the image files in the installation package of the application, reduce the proportion of the image files in the installation package of the application, and reduce the size of the installation package of the application.
[0074] The following specific embodiments are used to describe in detail the technical solutions of the present invention and how the technical solutions of the present application solve the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present invention will be described below in conjunction with the accompanying drawings.
[0075] Figure 2 This is a flow chart of a method for managing application images provided in Embodiment 1 of the present invention, such as Figure 2 As shown, the method in this embodiment may include:
[0076] S101. If there are pictures that are not downloaded through the network in the installation package of the application, the pictures that are not downloaded through the network are used as pictures to be selected.
[0077] In this embodiment, pictures that can be downloaded through the network and pictures that cannot be downloaded through the network can be divided according to the scene in which the pictures are used. The classification of pictures depends on the user experience, and the use of network download depends on the specific user group of the App. For pictures that can be downloaded through the network, only a network link address needs to be stored in the installation package, and it can be downloaded when used. The processing of these pictures will be described in detail later. For pictures that cannot be downloaded from the network, the pictures need to be placed in the installation package of the application program. They will be the pictures that need to be processed in the subsequent steps of this embodiment. These pictures are called selected pictures. An App can be divided into many modules according to different businesses. Each module can create an Asset Catalog file with an xcassets suffix separately to store the selected pictures. Then, all the selected pictures are put into the AssetCatalog. In order to avoid conflicts between modules when Xcode compiles and merges the Asset Catalog, prefixes need to be added to the selected pictures added.
[0078] S102: Load the selected pictures into the image resource management tool to obtain the picture set file of the initial installation package.
[0079] In this embodiment, when all the images to be selected are placed in the Asset Catalog, an installation package with the .ipa suffix is output. The installation package here is not uploaded to the App Store, so it will not be optimized through the slicing of App Thinning to obtain the Assets.car file. Assets.car is a collection of images stored in the Asset Catalog that is merged when Xcode is compiled.
[0080] S103: Extract a first target picture and a second target picture from the picture set file.
[0081] In this embodiment, a 2x screen image is extracted from the image set file as the first target image, and a 3x screen image is extracted as the second target image.
[0082] Specifically, simulate the implementation of Slicing of App Thinning, split the images used by 2x and 3x screens in Assets.car and calculate the total size of the images. Each image put into the Asset Catalog will be put into an image set with 2x and 3x sizes, and a Content.json file will be generated to manage the images. By analyzing Content.json, the size of the local project for 2x and 3x screen phones in the local project can be obtained.
[0083] S104: Classify the pictures in the picture set file into different types according to the first target picture and the second target picture.
[0084] In this embodiment, a critical value for dividing pictures is determined according to the first target picture and the second target picture; and pictures in the picture set file are divided into first category pictures and second category pictures according to the critical value.
[0085] Specifically, according to the above steps, the sum of the sizes of local images and images actually installed by users is obtained. A critical value can be divided according to the different image composition and color space of each App, or a critical value for division can be set manually. According to the critical value, the images in the image collection file are divided into the first category and the second category. The first category of images refers to images with large file storage space. This part of images accounts for a small proportion of the total number of images, but a large proportion of the total size, and cannot be directly placed in the Asset Catalog. The second category of images refers to images with small file storage space. This part of images accounts for a large proportion of the total number of images, but a small proportion of the total size. This part of images continues to be placed in the Assets Catalog. App Thinning Slicing can be used for distribution. Because this part of the images is very small, even if it is affected by the re-compression of Xcode, the proportion of the overall size of the App package does not increase (compared with the first category of images). The critical value can be set manually according to the file size, or the critical value can be set by 2x screen comparison. Specifically, the total size of the optimized image = the total size of the local large image (3x image used) + the total size of the small and medium images in Assets.car. The total size of the optimized image is minimized, which is the critical value for dividing the first and second category images.
[0086] S105: storing the pictures in the picture set file in different ways according to the picture types.
[0087] In this embodiment, the first type of pictures are taken from the picture file set, and it is determined whether to use the alpha channel for picture format conversion; if the alpha channel is used, the first type of pictures are stored in the Bundle in PNG format; if the alpha channel is not used, the first type of pictures are stored in the Bundle in JPG format. Optionally, the second type of pictures are retained in the picture file set and optimized using AppThinning.
[0088] Specifically, for the first type of pictures, if the alpha channel is not used, convert them into JPG picture format to make the compression ratio of the pictures higher and put them into the Bundle. If the alpha channel is used, continue to use the PNG picture format and put them into the Bundle. And only keep 3 times the pictures for use. In this way, after optimization, the pictures that have been losslessly compressed will not be affected by the recompression of Xcode, and the optimization purpose will be achieved.
[0089] For the second type of images, continue to put them in the Assets Catalog and use App ThinningSlicing distribution, because these images are very small in themselves, and even if they are affected by Xcode's recompression and increase in size, the proportion of the images in the overall App package size does not increase.
[0090] In this embodiment, if there are pictures that are not downloaded through the network in the installation package of the application, the pictures that are not downloaded through the network are used as the pictures to be selected; the pictures to be selected are loaded into the image resource management tool to obtain the picture set file of the initial installation package; the first target picture and the second target picture are extracted from the picture set file; the pictures in the picture set file are divided into different types according to the first target picture and the second target picture; and the pictures in the picture set file are stored in different ways according to the picture type. The present invention can effectively manage the picture files in the installation package of the application, reduce the proportion of the picture files in the installation package of the application, and reduce the size of the installation package of the application.
[0091] Figure 3 This is a flow chart of a method for managing application images provided in Embodiment 2 of the present invention, such as Figure 3 As shown, the method in this embodiment may include:
[0092] S201. If there are pictures that are not downloaded through the network in the installation package of the application, the pictures that are not downloaded through the network are used as pictures to be selected.
[0093] S202: Load the selected pictures into the image resource management tool to obtain the picture set file of the initial installation package.
[0094] S203: Extract a first target picture and a second target picture from the picture set file.
[0095] S204: Classify the pictures in the picture set file into different types according to the first target picture and the second target picture.
[0096] S205: storing the pictures in the picture set file in different ways according to the picture type.
[0097] In this embodiment, the specific implementation process and technical principles of steps S201 to S205 can be found in Figure 2 The relevant descriptions of steps S101 to S105 in the method shown are not repeated here.
[0098] S206: If there are pictures downloaded from the network in the installation package of the application, upload the pictures downloaded from the network to the picture library of the server, and save the corresponding picture download link in the application installation package.
[0099] In the present embodiment, the pictures that can be downloaded through the network only need to store a network link address in the installation package. Therefore, these parts of pictures are uploaded to the picture library of the server, and the corresponding picture download link is stored in the application installation package.
[0100] S207: Perform any one or more of the following operations on the image files in the installation package of the application program through a visualization tool: adding an image, deleting an image, recompressing the image, and searching the image.
[0101] In this embodiment, with the iteration of the application version, the local pictures are added and deleted, and such comparison work is done by human beings, which wastes manpower and is inefficient. Customized development of visualization tools makes the overall process more convenient and faster. Figure 4 A flow chart of a visualization tool provided by an embodiment of the present invention, such as Figure 4 As shown, you can search for images by module and all. Image information includes thumbnail (large image), storage location, size, size of ipa, and module used. When deleting an image, the corresponding module developers will be informed and authorized to delete it. If the module developers delete it uniformly, the image deletion operation will be executed. When adding an image, it will be optimized through unified compression. Different operations will be performed depending on whether it is downloaded from the network. For images that cannot be downloaded from the network, an additional image drive deduplication logic will be added, including size comparison, partial MD5 signature comparison, full MD5 signature comparison, and byte-to-byte comparison. Four steps are used to determine whether there are corresponding duplicate images. If a new image has been added, the previously added image will be used. During the testing phase of monitoring, after the ipa package is generated, the script automatically analyzes the ipa. If there are unqualified images, the target developers will be informed by email and authorized to change the image location.
[0102] In this embodiment, if there are pictures that are not downloaded through the network in the installation package of the application, the pictures that are not downloaded through the network are used as the pictures to be selected; the pictures to be selected are loaded into the image resource management tool to obtain the picture set file of the initial installation package; the first target picture and the second target picture are extracted from the picture set file; the pictures in the picture set file are divided into different types according to the first target picture and the second target picture; and the pictures in the picture set file are stored in different ways according to the picture type. The present invention can effectively manage the picture files in the installation package of the application, reduce the proportion of the picture files in the installation package of the application, and reduce the size of the installation package of the application.
[0103] In addition, this embodiment can also upload the pictures downloaded through the network to the picture library of the server, and save the corresponding picture download link in the application installation package. It is also possible to perform any or multiple operations of adding pictures, deleting pictures, recompressing pictures, and searching pictures on the picture files in the application installation package through the visualization tool. In this way, the picture files in the application installation package can be effectively managed, the proportion of picture files in the application installation package can be reduced, and the size of the application installation package can be reduced.
[0104] Figure 5 This is a schematic diagram of the structure of the application image management device provided in the third embodiment of the present invention, such as Figure 5 As shown, the application picture management device of this embodiment may include:
[0105] A pre-selection module 31, for, when there are pictures not downloaded through the network in the installation package of the application, using the pictures not downloaded through the network as pictures to be selected;
[0106] A loading module 32 is used to load the selected pictures into the image resource management tool to obtain a picture set file of the initial installation package;
[0107] An extraction module 33, used to extract a first target image and a second target image from the image set file;
[0108] A classification module 34, configured to classify the pictures in the picture set file into different types according to the first target picture and the second target picture;
[0109] The storage module 35 is used to store the pictures in the picture set file in different ways according to the picture type.
[0110] In a possible design, the extraction module 33 is specifically configured to:
[0111] A 2x screen image is extracted from the image set file as the first target image, and a 3x screen image is extracted as the second target image.
[0112] In a possible design, the partitioning module 34 is specifically used to:
[0113] Determining a critical value for dividing the picture according to the first target picture and the second target picture;
[0114] According to the critical value, the pictures in the picture set file are divided into the first category of pictures and the second category of pictures.
[0115] In a possible design, the storage module 35 is specifically used for:
[0116] Take the first type of pictures from the picture file set, and determine whether to use the alpha channel to convert the picture format;
[0117] If the alpha channel is used, the first type of image is stored in the Bundle in PNG format;
[0118] If the alpha channel is not used, the first type of images are stored in the Bundle in JPG format.
[0119] In a possible design, the storage module 35 is specifically used for:
[0120] The second type of images are retained in the image file set and optimized using AppThinning.
[0121] The application image management device of this embodiment can execute Figure 2 For the technical solution in the method shown, its specific implementation process and technical principles can be found in Figure 2 The relevant descriptions in the method shown will not be repeated here.
[0122] In this embodiment, if there are pictures that are not downloaded through the network in the installation package of the application, the pictures that are not downloaded through the network are used as the pictures to be selected; the pictures to be selected are loaded into the image resource management tool to obtain the picture set file of the initial installation package; the first target picture and the second target picture are extracted from the picture set file; the pictures in the picture set file are divided into different types according to the first target picture and the second target picture; and the pictures in the picture set file are stored in different ways according to the picture type. The present invention can effectively manage the picture files in the installation package of the application, reduce the proportion of the picture files in the installation package of the application, and reduce the size of the installation package of the application.
[0123] Figure 6 A schematic diagram of the structure of the application image management device provided in the fourth embodiment of the present invention, such as Figure 6 As shown, the management device of the application picture of this embodiment is Figure 5 Based on the device shown, it can also include:
[0124] The uploading module 36 is used to upload the pictures downloaded from the network to the picture library of the server when there are pictures downloaded from the network in the installation package of the application, and save the corresponding picture download link in the application installation package.
[0125] In a possible design, it also includes: an editing module 37, which is used to perform any one or more operations including adding pictures, deleting pictures, recompressing pictures, and searching pictures on the picture files in the installation package of the application through a visual tool.
[0126] The application image management device of this embodiment can execute Figure 2 , Figure 3 For the technical solution in the method shown, its specific implementation process and technical principles can be found in Figure 2 , Figure 3 The relevant descriptions in the method shown will not be repeated here.
[0127] In this embodiment, if there are pictures that are not downloaded through the network in the installation package of the application, the pictures that are not downloaded through the network are used as the pictures to be selected; the pictures to be selected are loaded into the image resource management tool to obtain the picture set file of the initial installation package; the first target picture and the second target picture are extracted from the picture set file; the pictures in the picture set file are divided into different types according to the first target picture and the second target picture; and the pictures in the picture set file are stored in different ways according to the picture type. The present invention can effectively manage the picture files in the installation package of the application, reduce the proportion of the picture files in the installation package of the application, and reduce the size of the installation package of the application.
[0128] In addition, this embodiment can also upload the pictures downloaded through the network to the picture library of the server, and save the corresponding picture download link in the application installation package. It is also possible to perform any or multiple operations of adding pictures, deleting pictures, recompressing pictures, and searching pictures on the picture files in the application installation package through the visualization tool. In this way, the picture files in the application installation package can be effectively managed, the proportion of picture files in the application installation package can be reduced, and the size of the application installation package can be reduced.
[0129] Figure 7 A schematic diagram of the structure of an application image management device provided in Embodiment 5 of the present invention, such as Figure 7 As shown, the application picture management device 40 of this embodiment may include: a processor 41 and a memory 42.
[0130] The memory 42 is used to store programs; the memory 42 may include volatile memory (English: volatile memory), such as random-access memory (English: random-access memory, abbreviated: RAM), such as static random-access memory (English: static random-access memory, abbreviated: SRAM), double data rate synchronous dynamic random access memory (English: Double Data Rate Synchronous Dynamic Random Access Memory, abbreviated: DDR SDRAM), etc.; the memory may also include non-volatile memory (English: non-volatile memory), such as flash memory (English: flash memory). The memory 42 is used to store computer programs (such as applications, functional modules, etc. that implement the above method), computer instructions, etc., and the above computer programs, computer instructions, etc. can be partitioned and stored in one or more memories 42. And the above computer programs, computer instructions, data, etc. can be called by the processor 41.
[0131] The above-mentioned computer programs, computer instructions, etc. may be stored in one or more memories 42 in partitions. And the above-mentioned computer programs, computer instructions, data, etc. may be called by the processor 41.
[0132] The processor 41 is used to execute the computer program stored in the memory 42 to implement the various steps in the method involved in the above embodiment.
[0133] For details, please refer to the relevant description in the previous method embodiment.
[0134] The processor 41 and the memory 42 may be independent structures or integrated structures. When the processor 41 and the memory 42 are independent structures, the memory 42 and the processor 41 may be coupled and connected via a bus 43 .
[0135] The application image management device of this embodiment can execute Figure 2 , Figure 3 For the technical solution in the method shown, its specific implementation process and technical principles can be found in Figure 2 , Figure 3 The relevant descriptions in the method shown will not be repeated here.
[0136] In addition, an embodiment of the present application further provides a computer-readable storage medium, in which computer-executable instructions are stored. When at least one processor of a user device executes the computer-executable instructions, the user device executes the above-mentioned various possible methods.
[0137] Among them, computer-readable media include computer storage media and communication media, wherein the communication media include any media that facilitates the transmission of computer programs from one place to another. The storage medium can be any available medium that can be accessed by a general or special-purpose computer. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be an integral part of the processor. The processor and the storage medium can be located in an ASIC. In addition, the ASIC can be located in a user device. Of course, the processor and the storage medium can also be present in a communication device as discrete components.
[0138] The present application also provides a program product, which includes a computer program. The computer program is stored in a readable storage medium. At least one processor of the server can read the computer program from the readable storage medium. At least one processor executes the computer program so that the server implements any method of the above-mentioned embodiments of the present invention.
[0139] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0140] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for managing application pictures, characterized in that: include: If there are pictures that are not downloaded through the network in the installation package of the application, the pictures that are not downloaded through the network are used as the pictures to be selected; Loading the selected image with the prefix added into an image resource management tool to obtain an image set file of an initial installation package, wherein the initial installation package is not uploaded to the App Store; Extracting a first target picture and a second target picture from the picture set file; Determining a critical value for dividing the picture according to differences in composition of the first target picture and the second target picture and differences in picture color spaces; According to the critical value, the pictures in the picture set file are divided into a first category of pictures and a second category of pictures; Taking the first type of pictures from the picture set file, and determining whether to use the alpha channel for picture format conversion; If an alpha channel is used, the first type of image is stored in the Bundle in PNG format; If the alpha channel is not used, the first type of pictures are stored in the Bundle in JPG format.
2. The method according to claim 1, characterized in that Extracting a first target picture and a second target picture from the picture set file includes: A 2x screen image is extracted from the image set file as the first target image, and a 3x screen image is extracted as the second target image.
3. The method according to claim 1, characterized in that The method further comprises: The second type of pictures are retained in the picture set file and optimized using AppThinning.
4. The method according to any one of claims 1 to 3, characterized in that Also includes: If there are pictures downloaded from the network in the installation package of the application, the pictures downloaded from the network are uploaded to the picture library of the server, and the corresponding picture download link is saved in the installation package of the application.
5. The method according to any one of claims 1 to 3, characterized in that: Also includes: Use a visualization tool to perform any one or more operations of adding, deleting, recompressing, and searching for images on the image files in the installation package of the application.
6. A management device for application pictures, characterized in that: include: A pre-selection module, used for, when there are pictures not downloaded through the network in the installation package of the application, taking the pictures not downloaded through the network as pictures to be selected; A loading module, used for loading the selected image with the prefix added into an image resource management tool to obtain an image set file of an initial installation package, wherein the initial installation package is not uploaded to the App Store; An extraction module, used to extract a first target image and a second target image from the image set file; a classification module, configured to classify the pictures of the picture set file into different types according to the first target picture and the second target picture; A storage module, used for storing the pictures in the picture set file in different ways according to the picture type; The division module is specifically used for: Determine a critical value for dividing the images according to differences in composition of the first target image and the second target image and differences in image color spaces; According to the critical value, the pictures in the picture set file are divided into the first category of pictures and the second category of pictures; The storage module is specifically used for: Take the first type of pictures from the picture set file and determine whether to use the alpha channel for picture format conversion; If the alpha channel is used, the first type of image is stored in the Bundle in PNG format; If the alpha channel is not used, the first type of images are stored in the Bundle in JPG format.
7. A device for managing application images, characterized in that: include: A memory and a processor, wherein the memory stores executable instructions of the processor; wherein the processor is configured to execute the method for managing application images according to any one of claims 1 to 5 by executing the executable instructions.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method for managing application images described in any one of claims 1 to 5 is implemented.