Works processing method, device, electronic device and storage medium
By determining the target splicing template based on the number and size of the pictures, splicing multiple pictures and generating preview pictures, the problem of cumbersome display operations of multiple pictures is solved and the human-computer interaction efficiency is improved.
Patent Information
- Application Number
- CN202011540248.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-23
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2040-12-23
AI Technical Summary
In works published on the Internet, the display of multiple pictures is cumbersome, resulting in low human-computer interaction efficiency, and users need to manually slide to view all pictures.
By obtaining multiple pictures of the work, determining the target splicing template according to the number and size of the picture, splicing according to the display position indicated by the template, generating a preview picture, and publishing it to the server, allowing users to view all pictures at once.
It simplifies work browsing operations and improves human-computer interaction efficiency. Users can view all pictures without manual operations, making it easy to operate.
Smart Images

Figure CN112667835B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a work processing method, device, electronic device and storage medium. Background Art
[0002] With the development of Internet technology, more and more people are beginning to share their lives by publishing works on the Internet. Some works include multiple pictures. When displaying multiple pictures in a work, one picture is usually displayed on the cover, and then other pictures are displayed based on the user's sliding operation. The operation is cumbersome, resulting in low human-computer interaction efficiency. Summary of the invention
[0003] The present disclosure provides a work processing method, device, electronic device and storage medium to simplify the operation of browsing works and improve the efficiency of human-computer interaction. The technical solution of the present disclosure is as follows:
[0004] According to a first aspect of an embodiment of the present disclosure, a method for processing a work is provided, the method comprising:
[0005] In response to a publishing operation on a work, a plurality of pictures corresponding to the work are obtained;
[0006] Based on the number of pictures and the sizes of the multiple pictures, determine a target stitching template, the target stitching template matches the number and size of the pictures, and the target stitching template is used to limit the display position of the pictures;
[0007] splicing the multiple images according to the display positions indicated by the target splicing template to obtain a target image;
[0008] Use the target image as the preview image of the work and publish the work to the target server.
[0009] When a work is to be published, multiple pictures corresponding to the work to be published are obtained, and based on the number and size of the pictures, a target stitching template that matches the number and size of the pictures is determined, and then the multiple pictures are stitched together according to the display position indicated by the target stitching template, and the stitched target picture is used as the preview picture of the work to be published to publish the work. After the work is published, other users can see the preview picture when browsing the work, so that they can see all the pictures in the work at one time without manual operation by the user, which is simple to operate and improves the efficiency of human-computer interaction.
[0010] In some embodiments, stitching the multiple images according to the display positions indicated by the target stitching template to obtain the target image includes:
[0011] Acquire sorting information of the plurality of images based on the target stitching template, where the sorting information is used to indicate a display order of the plurality of images;
[0012] Determining display positions corresponding to the multiple images in the target splicing template according to the sorting information of the multiple images;
[0013] The multiple pictures are spliced according to the determined display positions to obtain the target picture.
[0014] By obtaining the sorting information of multiple pictures, the positions of the multiple pictures in the target template can be determined according to the sorting information, and then the multiple pictures can be spliced together, so that the pictures that the user wants to display first are displayed in the front position, thereby improving the display effect.
[0015] In some embodiments, determining the target stitching template based on the number of pictures and the sizes of the multiple pictures includes:
[0016] Determining a picture layout of each picture in the multiple pictures based on the aspect ratio of the multiple pictures;
[0017] The picture layout with the largest number of corresponding pictures is determined as the target picture layout;
[0018] Based on the target image layout and the number of images, a target splicing template corresponding to the target image layout and the number of images is determined.
[0019] By determining the picture layout of the pictures, the target splicing template is determined according to the picture layout corresponding to the largest number of pictures, so that the determined target splicing template is more consistent with the picture layout and the number of pictures of the multiple pictures, thereby improving the display effect.
[0020] In some embodiments, determining the image layout of each of the multiple images based on the aspect ratio of the multiple images includes:
[0021] For any picture among the multiple pictures, if the aspect ratio of the picture is greater than the preset aspect ratio, the picture format of the picture is determined to be a vertical version;
[0022] If the aspect ratio of any one of the pictures is equal to the preset aspect ratio, the picture format of any one of the pictures is determined to be a square format;
[0023] If the aspect ratio of any of the images is smaller than the preset aspect ratio, the image layout of any of the images is determined to be a horizontal layout.
[0024] By comparing the aspect ratio of each picture with the preset aspect ratio, the picture layout of each picture can be determined, so that a suitable target splicing template can be determined based on the picture layout later.
[0025] In some embodiments, after determining the picture layout of each of the multiple pictures based on the aspect ratio of the multiple pictures, the method further includes:
[0026] If there are at least two picture layouts corresponding to the same number of pictures, then the stitching template corresponding to the picture layout of the picture that is ranked highest among the pictures corresponding to the at least two picture layouts is determined as the target stitching template.
[0027] When there are two picture layouts with the same number of pictures corresponding to them, the stitching template corresponding to the picture that is ranked first is used. Since the picture that is ranked first is generally the picture that the user most wants to display, the target stitching template determined based on the picture that is ranked first is more suitable for displaying the picture that the user most wants to display, thereby improving the display effect.
[0028] In some embodiments, before stitching the multiple images according to the display positions indicated by the target stitching template to obtain the target image, the method further includes:
[0029] If there is at least one to-be-processed picture among the multiple pictures, the size of the at least one to-be-processed picture is adjusted according to the target aspect ratio corresponding to the target stitching template, and the to-be-processed picture is a picture whose size does not conform to the target stitching template.
[0030] When there is a to-be-processed picture whose size does not conform to the target stitching template among multiple pictures, the to-be-processed picture is resized according to the target aspect ratio corresponding to the target stitching template, so that each picture conforms to the target aspect ratio corresponding to the target stitching template, thereby improving the display effect of each picture.
[0031] In some embodiments, the target aspect ratio includes a first target aspect ratio and a second target aspect ratio;
[0032] The resizing of the at least one to-be-processed picture according to the target aspect ratio corresponding to the target stitching template includes:
[0033] For any picture to be processed among the at least one picture to be processed, if the layout information of the picture to be processed is vertical, and the aspect ratio of the picture to be processed is greater than or equal to the first target aspect ratio, scaling the picture to be processed in equal proportion;
[0034] If the layout information of any image to be processed is vertical, and the aspect ratio of any image to be processed is smaller than the first target aspect ratio, the image to be processed is cropped in the center;
[0035] If the layout information of any image to be processed is horizontal, and the aspect ratio of any image to be processed is less than or equal to the first target aspect ratio, scaling the image to be processed in equal proportion;
[0036] If the layout information of any image to be processed is horizontal, and the aspect ratio of any image to be processed is greater than the first target aspect ratio, the image to be processed is cropped in the center.
[0037] When the aspect ratio of the image does not meet the requirements, the image is resized in proportion or cropped in the center by using a size adjustment method corresponding to the aspect ratio of the image, so that the image is more suitable for the target splicing template, thereby improving the display effect.
[0038] In some embodiments, the method further comprises:
[0039] When cropping any of the images to be processed, the images to be processed are cropped based on the positions of the characters in the images to be processed.
[0040] By cropping the image based on the position of the person in the image, the cropped image can still completely include the person in the image, thereby improving the display effect.
[0041] According to a second aspect of an embodiment of the present disclosure, there is provided a work processing device, the device comprising:
[0042] An acquisition unit, configured to execute a response to a publishing operation on a work and acquire a plurality of pictures corresponding to the work;
[0043] A determination unit is configured to determine a target stitching template based on the number of pictures and the sizes of the multiple pictures, the target stitching template matches the number and size of the pictures, and the target stitching template is used to limit the display position of the pictures;
[0044] A splicing unit is configured to splice the multiple images according to the display positions indicated by the target splicing template to obtain a target image;
[0045] The publishing unit is configured to use the target image as the preview image of the work and publish the work to the target server.
[0046] In some embodiments, the stitching unit is configured to obtain sorting information of the multiple pictures based on the target stitching template, and the sorting information is used to indicate the display order of the multiple pictures; determine the display positions corresponding to the multiple pictures in the target stitching template according to the sorting information of the multiple pictures; and stitch the multiple pictures according to the determined display positions to obtain the target picture.
[0047] In some embodiments, the determination unit includes a layout determination subunit and a template determination subunit;
[0048] The layout determination subunit is configured to determine the picture layout of each of the multiple pictures based on the aspect ratio of the multiple pictures;
[0049] The layout determination subunit is further configured to determine the picture layout with the largest number of corresponding pictures as the target picture layout;
[0050] The template determination subunit is configured to determine a target splicing template corresponding to the target image layout and the number of images based on the target image layout and the number of images.
[0051] In some embodiments, the layout determination subunit is configured to execute, for any picture among the multiple pictures, if the aspect ratio of any picture is greater than a preset aspect ratio, then the picture layout of any picture is determined as a vertical layout; if the aspect ratio of any picture is equal to the preset aspect ratio, then the picture layout of any picture is determined as a square layout; if the aspect ratio of any picture is less than the preset aspect ratio, then the picture layout of any picture is determined as a horizontal layout.
[0052] In some embodiments, the template determination subunit is further configured to determine the target splicing template as the splicing template corresponding to the picture layout of the picture with the highest sorting among the pictures corresponding to the at least two picture layouts if there are at least two picture layouts corresponding to the same number of pictures.
[0053] In some embodiments, the apparatus further comprises:
[0054] The adjustment unit is configured to execute, if there is at least one to-be-processed picture among the multiple pictures, resizing the at least one to-be-processed picture according to the target aspect ratio corresponding to the target stitching template, and the to-be-processed picture is a picture whose size does not conform to the target stitching template.
[0055] In some embodiments, the target aspect ratio includes a first target aspect ratio and a second target aspect ratio;
[0056] The adjustment unit is configured to perform proportional scaling on any of the at least one picture to be processed, if the layout information of the picture to be processed is vertical and the aspect ratio of the picture to be processed is greater than or equal to the first target aspect ratio; if the layout information of the picture to be processed is vertical and the aspect ratio of the picture to be processed is less than the first target aspect ratio, then the picture to be processed is centered; if the layout information of the picture to be processed is horizontal and the aspect ratio of the picture to be processed is less than or equal to the first target aspect ratio, then the picture to be processed is proportional scaling; if the layout information of the picture to be processed is horizontal and the aspect ratio of the picture to be processed is greater than the first target aspect ratio, then the picture to be processed is centered.
[0057] In some embodiments, the apparatus further comprises:
[0058] The cropping unit is configured to crop any image to be processed based on the position of a person in the image to be processed when cropping the image to be processed.
[0059] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:
[0060] processor;
[0061] a memory for storing instructions executable by the processor;
[0062] Among them, the processor is configured to execute the instruction to implement the above-mentioned work processing method.
[0063] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the above-mentioned work processing method.
[0064] According to a fifth aspect of an embodiment of the present disclosure, there is provided a computer program product, comprising a computer program, which implements the above-mentioned work processing method when executed by a processor.
[0065] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.
[0067] Figure 1 is a schematic diagram of an implementation environment of a work processing method according to an exemplary embodiment;
[0068] Figure 2 is a flow chart of a method for processing works according to an exemplary embodiment;
[0069] Figure 3 is a flow chart of a method for processing works according to an exemplary embodiment;
[0070] Figure 4 is a schematic diagram of a splicing template according to an exemplary embodiment;
[0071] Figure 5 is a block diagram of a work processing device according to an exemplary embodiment;
[0072] Figure 6is a block diagram of an electronic device 600 according to an exemplary embodiment. DETAILED DESCRIPTION
[0073] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
[0074] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure 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 disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0075] The user information involved in the present disclosure may be information authorized by the user or fully authorized by all parties.
[0076] Figure 1 is a schematic diagram of an implementation environment of a work processing method according to an exemplary embodiment, see Figure 1 , the implementation environment specifically includes: an electronic device 101 and a server 102.
[0077] The electronic device 101 may be at least one of a smart phone, a smart watch, a laptop, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 (Moving Picture Experts Group Audio Layer IV) player, and a laptop computer. The electronic device 101 is connected to the server 102 via wired or wireless communication, which is not limited in the embodiments of the present disclosure. Multiple pictures are stored in the electronic device 101 so that the user can select pictures to be displayed from the multiple pictures. In response to the user's selection operation, the electronic device 101 uses the selected picture as the picture corresponding to the work to be published, and then sends the multiple pictures to the server 102.
[0078] The electronic device 101 may generally refer to one of a plurality of electronic devices, and this embodiment is only illustrated by the electronic device 101. Those skilled in the art may know that the number of the above terminals may be more or less. For example, the above electronic devices may be only a few, or the above electronic devices may be dozens or hundreds, or more. The embodiment of the present disclosure does not limit the number and type of electronic devices.
[0079] The server 102 can be at least one of a single server, multiple servers, a cloud server, a cloud computing platform, and a virtualization center. The server 102 is connected to the electronic device 101 via wired or wireless communication, which is not limited in the embodiment of the present disclosure. The server 102 receives multiple pictures sent by the electronic device 101, and then publishes the works corresponding to the multiple pictures, so that the electronic devices corresponding to other users can obtain the works corresponding to the multiple pictures, and then display the multiple pictures. Optionally, the number of the above servers can be more or less, which is not limited in the embodiment of the present disclosure. Of course, the server 102 can also include other functional servers to provide more comprehensive and diversified services.
[0080] Figure 2 is a flowchart of a method for processing works according to an exemplary embodiment. Figure 2 , the specific steps include:
[0081] In step S201, in response to a publishing operation on a work, the electronic device obtains a plurality of pictures corresponding to the work.
[0082] In step S202, the electronic device determines a target stitching template based on the number of pictures and the sizes of the multiple pictures, where the target stitching template matches the number and the sizes of the pictures, and is used to limit the display position of the pictures.
[0083] In step S203, the electronic device stitches the multiple pictures according to the display positions indicated by the target stitching template to obtain a target picture.
[0084] In step S204, the electronic device uses the target image as a preview image of the work and publishes the work to a target server.
[0085] The solution provided by the disclosed embodiment obtains multiple pictures corresponding to the work to be published when the work is to be published, determines a target stitching template that matches the number and size of the pictures based on the number and size of the pictures, and then stitches the multiple pictures according to the display position indicated by the target stitching template, and uses the stitched target picture as a preview picture of the work to be published to publish the work, so that after the work is published, other users can see the preview picture when browsing the work, so that they can see all the pictures in the work at one time, without the need for manual operation by the user, and the operation is simple, thereby improving the efficiency of human-computer interaction.
[0086] In some embodiments, stitching the multiple images according to the display positions indicated by the target stitching template to obtain the target image includes:
[0087] Acquire sorting information of the plurality of images based on the target stitching template, where the sorting information is used to indicate a display order of the plurality of images;
[0088] Determining display positions corresponding to the multiple images in the target splicing template according to the sorting information of the multiple images;
[0089] The multiple pictures are spliced according to the determined display positions to obtain the target picture.
[0090] In some embodiments, determining the target stitching template based on the number of pictures and the sizes of the multiple pictures includes:
[0091] Determining a picture layout of each picture in the multiple pictures based on the aspect ratio of the multiple pictures;
[0092] The picture layout with the largest number of corresponding pictures is determined as the target picture layout;
[0093] Based on the target image layout and the number of images, a target splicing template corresponding to the target image layout and the number of images is determined.
[0094] In some embodiments, determining the image layout of each of the multiple images based on the aspect ratio of the multiple images includes:
[0095] For any picture among the multiple pictures, if the aspect ratio of the picture is greater than the preset aspect ratio, the picture format of the picture is determined to be a vertical version;
[0096] If the aspect ratio of any one of the pictures is equal to the preset aspect ratio, the picture format of any one of the pictures is determined to be a square format;
[0097] If the aspect ratio of any of the images is smaller than the preset aspect ratio, the image layout of any of the images is determined to be a horizontal layout.
[0098] In some embodiments, after determining the picture layout of each of the multiple pictures based on the aspect ratio of the multiple pictures, the method further includes:
[0099] If there are at least two picture layouts corresponding to the same number of pictures, then the stitching template corresponding to the picture layout of the picture that is ranked highest among the pictures corresponding to the at least two picture layouts is determined as the target stitching template.
[0100] In some embodiments, before stitching the multiple images according to the display positions indicated by the target stitching template to obtain the target image, the method further includes:
[0101] If there is at least one to-be-processed picture among the multiple pictures, the size of the at least one to-be-processed picture is adjusted according to the target aspect ratio corresponding to the target stitching template, and the to-be-processed picture is a picture whose size does not conform to the target stitching template.
[0102] In some embodiments, the target aspect ratio includes a first target aspect ratio and a second target aspect ratio;
[0103] The resizing of the at least one to-be-processed picture according to the target aspect ratio corresponding to the target stitching template includes:
[0104] For any picture to be processed among the at least one picture to be processed, if the picture format of the picture to be processed is vertical, and the aspect ratio of the picture to be processed is greater than or equal to the first target aspect ratio, scaling the picture to be processed in equal proportion;
[0105] If the image format of any image to be processed is vertical, and the aspect ratio of any image to be processed is smaller than the first target aspect ratio, the image to be processed is cropped in the center;
[0106] If the image format of any image to be processed is horizontal, and the aspect ratio of any image to be processed is less than or equal to the first target aspect ratio, scaling the image to be processed in equal proportion;
[0107] If the image format of any image to be processed is horizontal, and the aspect ratio of any image to be processed is greater than the first target aspect ratio, the image to be processed is cropped in the center.
[0108] In some embodiments, the method further comprises:
[0109] When cropping any of the images to be processed, the images to be processed are cropped based on the positions of the characters in the images to be processed.
[0110] Figure 3is a flowchart of a method for processing works according to an exemplary embodiment. Figure 3 , the specific steps include:
[0111] In step S301, the electronic device obtains a plurality of pictures corresponding to the work in response to a publishing operation on the work.
[0112] It should be noted that the electronic device pre-stores multiple pictures and displays the multiple pictures. Each picture has a corresponding check control, so that the user can trigger the check control corresponding to each picture to select from the multiple pictures. After the user completes the selection, the publishing control is triggered. In response to the user's triggering operation, the electronic device obtains the multiple pictures selected by the user as the multiple pictures corresponding to the work to be published.
[0113] In step S302, the electronic device determines the picture layout of each picture in the multiple pictures based on the aspect ratio of the multiple pictures.
[0114] It should be noted that the aspect ratio of an image is the ratio of the width to the height of the image. When determining the width and height of an image, the directions of the width and height may be different in different usage scenarios. Taking a smartphone as an example, if the smartphone is in portrait mode, the width of the image is the side parallel to the upper and lower sides of the smartphone screen, and the height of the image is the side parallel to the left and right sides of the smartphone screen; and if the smartphone is in landscape mode, the width of the image is the side parallel to the left and right sides of the smartphone screen, and the height of the image is the side parallel to the upper and lower sides of the smartphone screen. Taking a desktop computer as an example, the width of the image is the side parallel to the upper and lower sides of the desktop computer screen, and the height of the image is the side parallel to the left and right sides of the desktop computer screen.
[0115] In some embodiments, when determining the picture layout of any picture among the multiple pictures, the electronic device determines the aspect ratio of any picture based on the size of the any picture, and then compares the aspect ratio of any picture with a preset aspect ratio to determine the picture layout of any picture.
[0116] It should be noted that the image layout of each image is determined by comparing the aspect ratio of each image with the preset aspect ratio. For any image among the multiple images, if the aspect ratio of any image is greater than the preset aspect ratio, the image layout of any image is determined to be a vertical layout; if the aspect ratio of any image is equal to the preset aspect ratio, the image layout of any image is determined to be a square layout; if the aspect ratio of any image is less than the preset aspect ratio, the image layout of any image is determined to be a horizontal layout. Among them, the preset aspect ratio is 1.
[0117] That is, assuming the height of any one of the pictures is a and the width is b, when a > b, the picture layout of any one of the pictures is a vertical layout; when a = b, the picture layout of any one of the pictures is a square layout; when a < b, the picture layout of any one of the pictures is a horizontal layout. Herein, both a and b are arbitrary positive values, and the embodiments of the present disclosure do not limit this.
[0118] It should be noted that the parameters of height a and width b in the above process are only an exemplary description method. In some embodiments, this parameter can be replaced for substitution, and the embodiments of the present disclosure do not limit this.
[0119] In step S303, the electronic device determines the picture layout with the largest number of corresponding pictures as the target picture layout.
[0120] In step S304, the electronic device determines a target splicing template corresponding to the target picture layout and the number of pictures based on the target picture layout and the number of pictures, and the target splicing template is used to define the display position of the pictures.
[0121] It should be noted that for the pictures of each picture layout and the splicing templates corresponding to different numbers of pictures, refer to Figure 4 , Figure 4 which is a schematic diagram of a splicing template shown according to an exemplary embodiment.
[0122] For example, when the picture layouts of these multiple pictures are all vertical layouts, the splicing template shown in the first column of Figure 4 is adopted, that is, the vertical splicing template; when the picture layouts of these multiple pictures are all square layouts, the splicing template shown in the second column of Figure 4 is adopted, that is, the square splicing template; when the picture layouts of these multiple pictures are all horizontal layouts, the splicing template shown in the third column of Figure 4 is adopted, that is, the horizontal splicing template. When these multiple pictures correspond to at least two picture layouts, the picture layout with a larger number of corresponding pictures than the other picture layouts is adopted. That is, when the number of pictures corresponding to the vertical layout is larger than the number of pictures corresponding to the other picture layouts, the splicing template shown in the first column of Figure 4 is adopted, that is, the vertical splicing template; when the number of pictures corresponding to the square layout is larger than the number of pictures corresponding to the other picture layouts, the splicing template shown in the second column of Figure 4 is adopted, that is, the square splicing template; when the number of pictures corresponding to the horizontal layout is larger than the number of pictures corresponding to the other picture layouts, the splicing template shown in the third column of Figure 4 is adopted, that is, the horizontal splicing template.
[0123] The picture layout of the pictures is determined through the above steps 302 to 304, so that the target splicing template is determined according to the picture layout corresponding to the largest number of pictures, so that the determined target splicing template is more consistent with the picture layout and the number of pictures of these multiple pictures, thereby improving the display effect.
[0124] In some embodiments, when the electronic device obtains the multiple pictures, it also obtains the sorting information of the multiple pictures, which is the order in which the multiple pictures are checked, and the sorting information is used to indicate the display order of the multiple pictures. If there are at least two picture layouts corresponding to the same number of pictures, then the splicing template corresponding to the picture layout with the smallest sorting information among the pictures corresponding to the at least two picture layouts is determined as the target splicing template.
[0125] That is, when there are two or three picture layouts with the same number of pictures, the splicing template corresponding to the picture layout with the higher picture sorting information is used as the target splicing template. For example, when the number of pictures corresponding to the vertical and horizontal layouts is the same, and the picture layout corresponding to the picture with sorting information 1 is the vertical layout, then Figure 4 The splicing template shown in the first column is the vertical version splicing template; when the number of pictures corresponding to the vertical version and the horizontal version is the same, and the picture layout corresponding to the picture with sorting information 1 is square, and the picture layout corresponding to the picture with sorting information 2 is vertical, then use Figure 4 The splicing template shown in the first column is the vertical splicing template.
[0126] When there are two picture layouts with the same number of pictures corresponding to them, the stitching module corresponding to the picture that is ranked first is used. Since the picture that is ranked first is generally the picture that the user most wants to display, the target stitching template determined based on the picture that is ranked first is more suitable for displaying the picture that the user most wants to display, thereby improving the display effect.
[0127] It should be noted that the above Figure 4 The splicing templates shown in the figure are only some exemplary splicing templates. In some embodiments, the splicing templates include other types. The embodiments of the present disclosure do not limit the specific types of the splicing templates.
[0128] In step S305, the electronic device stitches the multiple pictures according to the display positions indicated by the target stitching template to obtain the target picture.
[0129] In some embodiments, the electronic device adds the multiple pictures to the target stitching template according to the display position indicated by the target stitching template, stitches the multiple pictures together, and obtains the target picture.
[0130] It should be noted that the above process is explained by taking the random splicing of the multiple pictures as an example. In other embodiments, the electronic device determines the display positions corresponding to the multiple pictures in the target splicing template according to the sorting information of the multiple pictures, and splices the multiple pictures according to the determined display positions. That is, each display position in the target splicing template corresponds to corresponding position information, and the position information is used to indicate the label corresponding to each display position, so as to determine the display positions corresponding to the multiple pictures in the target splicing template according to the corresponding relationship between the sorting information and the label, thereby realizing the splicing of the multiple pictures.
[0131] For example, for a work to be published that contains three pictures, if the picture layouts of these three pictures are all vertical, Figure 4 The third stitching template of the vertical stitching template shown in the first column is determined as the target stitching template. According to the sorting information of the three pictures, the display position corresponding to the picture with sorting information of 1 in the target stitching template is determined as the display position on the left of the target stitching template, the display position corresponding to the picture with sorting information of 2 in the target stitching template is determined as the display position in the upper right half of the target stitching template, and the display position corresponding to the picture with sorting information of 3 in the target stitching template is determined as the display position in the lower right half of the target stitching template, thereby realizing the stitching of the three pictures.
[0132] By obtaining the sorting information of multiple pictures, the positions of the multiple pictures in the target template can be determined according to the sorting information, and then the multiple pictures can be spliced together, so that the pictures that the user wants to display first are displayed in the front position, thereby improving the display effect.
[0133] In some embodiments, the electronic device detects the aspect ratio of the multiple pictures, and if there is at least one picture to be processed among the multiple pictures, the electronic device resizes the at least one picture to be processed according to the target aspect ratio corresponding to the target stitching template, and the picture to be processed is a picture whose size does not conform to the target stitching template. When there is a picture whose size does not conform to the target stitching template among the multiple pictures, the pictures are resized according to the target aspect ratio corresponding to the target stitching template, so that each picture conforms to the target aspect ratio corresponding to the target stitching template, thereby improving the display effect of each picture.
[0134] The target aspect ratio includes a first target aspect ratio and a second target aspect ratio, the first target aspect ratio is the target aspect ratio corresponding to a picture whose picture layout is a vertical version, and the second target aspect ratio is the target aspect ratio corresponding to a picture whose picture layout is a horizontal version. For any picture to be processed among the at least one picture to be processed, if the picture layout of the picture to be processed is a vertical version and the aspect ratio of the picture to be processed is greater than or equal to the first target aspect ratio, the picture to be processed is scaled proportionally; if the picture layout of the picture to be processed is a vertical version and the aspect ratio of the picture to be processed is less than the first target aspect ratio, the picture to be processed is centered cropped; if the picture layout of the picture to be processed is a horizontal version and the aspect ratio of the picture to be processed is less than or equal to the first target aspect ratio, the picture to be processed is scaled proportionally; if the picture layout of the picture to be processed is a horizontal version and the aspect ratio of the picture to be processed is greater than the first target aspect ratio, the picture to be processed is centered cropped. When the aspect ratio of the image does not meet the requirements, the image is resized in proportion or cropped in the center by using a size adjustment method corresponding to the aspect ratio of the image, so that the image is more suitable for the target splicing template, thereby improving the display effect.
[0135] The first target aspect ratio is any positive value less than 1, and the second target aspect ratio is any positive value greater than 1. The embodiments of the present disclosure do not limit the specific values of the first target aspect ratio and the second target aspect ratio. The following is an example of the first target aspect ratio being 1:2 and the second target aspect ratio being 16:9:
[0136] Assuming that the height of any image to be processed is a and the width is b, if the image format of any image to be processed is vertical, when (a:b)<16:9, the image to be processed is scaled proportionally; when (a:b)>16:9, the image to be processed is cropped in the center. If the image format of any image to be processed is horizontal, when (a:b)<1:2, the image to be processed is scaled proportionally; when (a:b)>1:2, the image to be processed is cropped in the center.
[0137] It should be noted that when cropping any of the images to be processed, the images to be processed are cropped based on the positions of the people in the images to be processed. By cropping the images based on the positions of the people in the images, the cropped images can still completely include the people in the images, thereby improving the display effect.
[0138] In some embodiments, the electronic device identifies the position of a person in any picture to be processed, and then uses the position of the person as the center point to crop any picture to be processed to ensure that the cropped picture to be processed is centered on the person, thereby improving the display effect of any picture to be processed.
[0139] Through the above steps 303 to 304, the target stitching template used when stitching pictures can be determined based on the number and size of pictures, so that the pictures can be stitched according to the display position indicated by the target stitching template, and then the target picture for display is obtained, which includes multiple pictures, so that all the published pictures can be seen at one time without the need for manual operation by the user, which is simple to operate and improves the efficiency of human-computer interaction.
[0140] In step S306, the electronic device uses the target image as a preview image of the work and publishes the work to a target server.
[0141] It should be noted that after the work is published, other users can obtain the work through their respective electronic devices and then display the work. When displaying the work, the preview image of the work, that is, the target image, is displayed, and other users can slide in the interface displaying the target image, and the electronic device corresponding to the user responds to the user's sliding operation and displays the multiple images one by one.
[0142] When displaying the multiple pictures one by one, the multiple pictures are displayed according to the sorting information of the multiple pictures. In some embodiments, other methods are used to display the multiple pictures, which is not limited in the embodiments of the present disclosure.
[0143] The disclosed embodiment provides a scheme, by obtaining multiple pictures corresponding to the work to be published when the work is to be published, determining the target splicing template that matches the number and size of the pictures based on the number and size of the pictures, and then splicing the multiple pictures according to the display position indicated by the target splicing template, and using the spliced target picture as the preview picture of the work to be published, so that after the work is published, other users can see the preview picture when browsing the work, so that all pictures in the work can be seen at one time, without manual operation by the user, and the operation is simple, which improves the efficiency of human-computer interaction. For the work to be published containing multiple pictures, when aggregating the multiple pictures, that is, splicing the multiple pictures, the multiple pictures are resized according to the size of the multiple pictures, such as intercepting the corresponding position, so that the multiple pictures are spliced into the best display style, so that the thumbnail display of the multiple pictures becomes more beautiful, and the display effect of the multiple pictures is improved.
[0144] Figure 5 is a block diagram of a work processing device according to an exemplary embodiment. Figure 5 , the device comprises:
[0145] The acquisition unit 501 is configured to execute a response to a publishing operation on a work and acquire a plurality of pictures corresponding to the work;
[0146] The determining unit 502 is configured to determine a target stitching template based on the number of pictures and the sizes of the multiple pictures, the target stitching template matches the number and the size of the pictures, and the target stitching template is used to limit the display position of the pictures;
[0147] The stitching unit 503 is configured to stitch the multiple images according to the display positions indicated by the target stitching template to obtain a target image;
[0148] The publishing unit 504 is configured to use the target image as a preview image of the work and publish the work to a target server.
[0149] The device provided by the embodiment of the present disclosure obtains multiple pictures corresponding to the work to be published when the work is to be published, determines a target stitching template that matches the number and size of the pictures based on the number and size of the pictures, and then stitches the multiple pictures according to the display position indicated by the target stitching template, and publishes the work by using the stitched target picture as a preview picture of the work to be published, so that after the work is published, other users can see the preview picture when browsing the work, so that they can see all the pictures in the work at one time, without the need for manual operation by the user, and the operation is simple, thereby improving the efficiency of human-computer interaction.
[0150] In some embodiments, the stitching unit 503 is configured to obtain sorting information of the multiple pictures based on the target stitching template, and the sorting information is used to indicate the display order of the multiple pictures; determine the display positions corresponding to the multiple pictures in the target stitching template according to the sorting information of the multiple pictures; and stitch the multiple pictures according to the determined display positions to obtain the target picture.
[0151] In some embodiments, the determination unit 502 includes a layout determination subunit and a template determination subunit;
[0152] The layout determination subunit is configured to determine the picture layout of each of the multiple pictures based on the aspect ratio of the multiple pictures;
[0153] The layout determination subunit is further configured to determine the picture layout with the largest number of corresponding pictures as the target picture layout;
[0154] The template determination subunit is configured to determine a target splicing template corresponding to the target image layout and the number of images based on the target image layout and the number of images.
[0155] In some embodiments, the layout determination subunit is configured to execute, for any picture among the multiple pictures, if the aspect ratio of any picture is greater than a preset aspect ratio, then the picture layout of any picture is determined as a vertical layout; if the aspect ratio of any picture is equal to the preset aspect ratio, then the picture layout of any picture is determined as a square layout; if the aspect ratio of any picture is less than the preset aspect ratio, then the picture layout of any picture is determined as a horizontal layout.
[0156] In some embodiments, the template determination subunit is further configured to determine the target splicing template as the splicing template corresponding to the picture layout of the picture with the highest sorting among the pictures corresponding to the at least two picture layouts if there are at least two picture layouts corresponding to the same number of pictures.
[0157] In some embodiments, the apparatus further comprises:
[0158] The adjustment unit is configured to execute, if there is at least one to-be-processed picture among the multiple pictures, resizing the at least one to-be-processed picture according to the target aspect ratio corresponding to the target stitching template, and the to-be-processed picture is a picture whose size does not conform to the target stitching template.
[0159] In some embodiments, the target aspect ratio includes a first target aspect ratio and a second target aspect ratio;
[0160] The adjustment unit is configured to perform proportional scaling on any of the at least one picture to be processed, if the layout information of the picture to be processed is vertical and the aspect ratio of the picture to be processed is greater than or equal to the first target aspect ratio; if the layout information of the picture to be processed is vertical and the aspect ratio of the picture to be processed is less than the first target aspect ratio, then the picture to be processed is centered; if the layout information of the picture to be processed is horizontal and the aspect ratio of the picture to be processed is less than or equal to the first target aspect ratio, then the picture to be processed is proportional scaling; if the layout information of the picture to be processed is horizontal and the aspect ratio of the picture to be processed is greater than the first target aspect ratio, then the picture to be processed is centered.
[0161] In some embodiments, the apparatus further comprises:
[0162] The cropping unit is configured to crop any image to be processed based on the position of a person in the image to be processed when cropping the image to be processed.
[0163] Figure 61 is a block diagram of an electronic device 600 according to an exemplary embodiment. The electronic device 600 may be a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 player (Moving Picture Experts Group Audio Layer IV), a laptop computer or a desktop computer. The electronic device 600 may also be called a user device, a portable electronic device, a laptop electronic device, a desktop electronic device or other names.
[0164] Typically, the electronic device 600 includes: one or more processors 601 and one or more memories 602 .
[0165] The processor 601 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 601 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 601 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 601 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 601 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0166] The memory 602 may include one or more computer-readable storage media, which may be non-transitory. The memory 602 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 602 is used to store at least one program code, which is used to be executed by the processor 601 to implement the work processing method provided in the method embodiment of the present disclosure.
[0167] In some embodiments, the electronic device 600 may further optionally include: a peripheral device interface 603 and at least one peripheral device. The processor 601, the memory 602 and the peripheral device interface 603 may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface 603 via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 604, a display screen 605, a camera 606, an audio circuit 607, a positioning component 608 and a power supply 609.
[0168] The peripheral device interface 603 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 601 and the memory 602. In some embodiments, the processor 601, the memory 602, and the peripheral device interface 603 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 601, the memory 602, and the peripheral device interface 603 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.
[0169] The radio frequency circuit 604 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 604 communicates with communication networks and other communication devices through electromagnetic signals. The radio frequency circuit 604 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. Optionally, the radio frequency circuit 604 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and the like. The radio frequency circuit 604 can communicate with other electronic devices through at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: a metropolitan area network, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 604 may also include circuits related to NFC (Near Field Communication), which is not limited in the present disclosure.
[0170] The display screen 605 is used to display the UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 605 is a touch display screen, the display screen 605 also has the ability to collect touch signals on the surface or above the surface of the display screen 605. The touch signal can be input to the processor 601 as a control signal for processing. At this time, the display screen 605 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, the display screen 605 can be one, and the front panel of the electronic device 600 is set; in other embodiments, the display screen 605 can be at least two, which are respectively set on different surfaces of the electronic device 600 or are folded; in some other embodiments, the display screen 605 can be a flexible display screen, which is set on the curved surface or folded surface of the electronic device 600. Even, the display screen 605 can also be set to a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 605 can be made of materials such as LCD (Liquid Crystal Display), OLED (Organic Light-Em itting Diode, organic light-emitting diode).
[0171] The camera assembly 606 is used to capture images or videos. Optionally, the camera assembly 606 includes a front camera and a rear camera. Typically, the front camera is arranged on the front panel of the electronic device, and the rear camera is arranged on the back of the electronic device. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize the panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 606 may also include a flash. The flash can be a monochrome temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.
[0172] The audio circuit 607 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals and input them into the processor 601 for processing, or input them into the radio frequency circuit 604 to achieve voice communication. For the purpose of stereo acquisition or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the electronic device 600. The microphone may also be an array microphone or an omnidirectional acquisition microphone. The speaker is used to convert the electrical signal from the processor 601 or the radio frequency circuit 604 into sound waves. The speaker may be a traditional film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into sound waves audible to humans, but also convert the electrical signal into sound waves inaudible to humans for purposes such as ranging. In some embodiments, the audio circuit 607 may also include a headphone jack.
[0173] Positioning component 608 is used to locate the current geographic location of electronic device 600 to implement navigation or LBS (Location Based Service). Positioning component 608 can be a positioning component based on the US GPS (Global Positioning System), China's Beidou system, Russia's Grenas system or the European Union's Galileo system.
[0174] The power supply 609 is used to power various components in the electronic device 600. The power supply 609 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 609 includes a rechargeable battery, the rechargeable battery can support wired charging or wireless charging. The rechargeable battery can also be used to support fast charging technology.
[0175] In some embodiments, the electronic device 600 further includes one or more sensors 610 , including but not limited to: an acceleration sensor 611 , a gyroscope sensor 612 , a pressure sensor 613 , a fingerprint sensor 614 , an optical sensor 615 , and a proximity sensor 616 .
[0176] The acceleration sensor 611 can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established by the electronic device 600. For example, the acceleration sensor 611 can be used to detect the components of gravity acceleration on the three coordinate axes. The processor 601 can control the display screen 605 to display the user interface in a horizontal view or a vertical view according to the gravity acceleration signal collected by the acceleration sensor 611. The acceleration sensor 611 can also be used for collecting game or user motion data.
[0177] The gyro sensor 612 can detect the body direction and rotation angle of the electronic device 600, and the gyro sensor 612 can cooperate with the acceleration sensor 611 to collect the user's 3D actions on the electronic device 600. The processor 601 can implement the following functions based on the data collected by the gyro sensor 612: motion sensing (such as changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.
[0178] The pressure sensor 613 can be set on the side frame of the electronic device 600 and / or the lower layer of the display screen 605. When the pressure sensor 613 is set on the side frame of the electronic device 600, it can detect the user's holding signal of the electronic device 600, and the processor 601 performs left and right hand recognition or shortcut operation according to the holding signal collected by the pressure sensor 613. When the pressure sensor 613 is set on the lower layer of the display screen 605, the processor 601 controls the operability controls on the UI interface according to the user's pressure operation on the display screen 605. The operability controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.
[0179] The fingerprint sensor 614 is used to collect the user's fingerprint, and the processor 601 identifies the user's identity based on the fingerprint collected by the fingerprint sensor 614, or the fingerprint sensor 614 identifies the user's identity based on the collected fingerprint. When the user's identity is identified as a trusted identity, the processor 601 authorizes the user to perform relevant sensitive operations, which include unlocking the screen, viewing encrypted information, downloading software, paying, and changing settings. The fingerprint sensor 614 can be set on the front, back, or side of the electronic device 600. When a physical button or a manufacturer logo is set on the electronic device 600, the fingerprint sensor 614 can be integrated with the physical button or the manufacturer logo.
[0180] The optical sensor 615 is used to collect the ambient light intensity. In one embodiment, the processor 601 can control the display brightness of the display screen 605 according to the ambient light intensity collected by the optical sensor 615. Specifically, when the ambient light intensity is high, the display brightness of the display screen 605 is increased; when the ambient light intensity is low, the display brightness of the display screen 605 is reduced. In another embodiment, the processor 601 can also dynamically adjust the shooting parameters of the camera assembly 606 according to the ambient light intensity collected by the optical sensor 615.
[0181] The proximity sensor 616, also called a distance sensor, is usually disposed on the front panel of the electronic device 600. The proximity sensor 616 is used to collect the distance between the user and the front of the electronic device 600. In one embodiment, when the proximity sensor 616 detects that the distance between the user and the front of the electronic device 600 is gradually decreasing, the processor 601 controls the display screen 605 to switch from the screen-on state to the screen-off state; when the proximity sensor 616 detects that the distance between the user and the front of the electronic device 600 is gradually increasing, the processor 601 controls the display screen 605 to switch from the screen-off state to the screen-on state.
[0182] Those skilled in the art will understand that Figure 6 The structure shown in the figure does not constitute a limitation on the electronic device 600, and may include more or less components than those shown in the figure, or combine some components, or adopt a different component arrangement.
[0183] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory 602 including instructions, and the above instructions can be executed by a processor 601 of an electronic device 600 to complete the above work processing method. Optionally, the computer-readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, etc.
[0184] In an exemplary embodiment, a computer program product is also provided, including a computer program, which can be executed by the processor 601 of the electronic device to complete the method steps of the work processing method provided in the above embodiment.
[0185] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0186] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A method for processing works, characterized in that: The method comprises: In response to a publishing operation on a work, a plurality of pictures corresponding to the work and sorting information of the plurality of pictures are obtained; the sorting information of the plurality of pictures is the order in which each picture is selected, and the sorting information indicates the display order of the plurality of pictures in the work; Determining a picture layout of each of the multiple pictures based on aspect ratios of the multiple pictures; The picture layout with the largest number of corresponding pictures is determined as the target picture layout; Based on the target picture layout and the number of pictures, determining a target splicing template corresponding to the target picture layout and the number of pictures, wherein the target splicing template is used to limit a display position of the picture; If there are at least two picture layouts corresponding to the same number of pictures, then among the pictures corresponding to the at least two picture layouts, the splicing template corresponding to the picture layout of the picture with the most forward sorting information is determined as the target splicing template; Splicing the multiple images according to the display positions indicated by the target splicing template to obtain a target image; The target image is used as a preview image of the work, and the work is published to a target server.
2. The work processing method according to claim 1, characterized in that: The step of stitching the plurality of images according to the display positions indicated by the target stitching template to obtain the target image comprises: Determining display positions corresponding to the plurality of images in the target stitching template according to the sorting information of the plurality of images; The multiple pictures are spliced according to the determined display positions to obtain the target picture.
3. The work processing method according to claim 1, characterized in that: Determining the picture layout of each of the multiple pictures based on the aspect ratio of the multiple pictures includes: For any picture among the multiple pictures, if the aspect ratio of the picture is greater than the preset aspect ratio, the picture format of the picture is determined to be a vertical version; If the aspect ratio of any of the pictures is equal to the preset aspect ratio, the picture format of any of the pictures is determined to be a square format; If the aspect ratio of any of the images is smaller than the preset aspect ratio, the image layout of any of the images is determined to be a horizontal layout.
4. The work processing method according to claim 1, characterized in that: Before the plurality of images are stitched together according to the display positions indicated by the target stitching template to obtain the target image, the method further includes: If there is at least one to-be-processed picture among the multiple pictures, the size of the at least one to-be-processed picture is adjusted according to the target aspect ratio corresponding to the target stitching template, and the to-be-processed picture is a picture whose size does not conform to the target stitching template.
5. The work processing method according to claim 4, characterized in that: The target aspect ratio includes a first target aspect ratio and a second target aspect ratio; The resizing of the at least one image to be processed according to the target aspect ratio corresponding to the target stitching template includes: For any picture to be processed among the at least one picture to be processed, if the picture format of the picture to be processed is vertical, and the aspect ratio of the picture to be processed is greater than or equal to the first target aspect ratio, scaling the picture to be processed in equal proportion; If the image format of any of the to-be-processed images is vertical, and the aspect ratio of any of the to-be-processed images is smaller than the first target aspect ratio, center cropping any of the to-be-processed images; If the image format of any of the to-be-processed images is horizontal, and the aspect ratio of any of the to-be-processed images is less than or equal to the first target aspect ratio, scaling the to-be-processed images in equal proportion; If the image format of any of the images to be processed is horizontal, and the aspect ratio of any of the images to be processed is greater than the first target aspect ratio, the image to be processed is cropped in the center.
6. The work processing method according to claim 5, characterized in that: The method further comprises: When cropping any of the pictures to be processed, cropping is performed on any of the pictures to be processed based on the positions of the characters in the pictures to be processed.
7. A work processing device, characterized in that: The device comprises: an acquisition unit, configured to execute, in response to a publishing operation on a work, acquire a plurality of pictures corresponding to the work and sorting information of the plurality of pictures; the sorting information of the plurality of pictures is the order in which each picture is selected, and the sorting information indicates the display order of the plurality of pictures in the work; A determination unit, including a format determination subunit and a template determination subunit; The layout determination subunit is configured to determine the picture layout of each of the multiple pictures based on the aspect ratio of the multiple pictures; The layout determination subunit is further configured to determine the picture layout corresponding to the largest number of pictures as the target picture layout; The template determination subunit is configured to determine a target splicing template corresponding to the target image layout and the number of images based on the target image layout and the number of images, wherein the target splicing template is used to limit a display position of the image; The template determination subunit is further configured to determine, if there are at least two picture layouts corresponding to the same number of pictures, the splicing template corresponding to the picture layout of the picture with the most preceding sorting information among the pictures corresponding to the at least two picture layouts as the target splicing template; a splicing unit configured to splice the plurality of images according to the display positions indicated by the target splicing template to obtain a target image; The publishing unit is configured to use the target image as a preview image of the work and publish the work to a target server.
8. The work processing device according to claim 7, characterized in that: The stitching unit is configured to acquire sorting information of the plurality of images based on the target stitching template, wherein the sorting information is used to indicate a display order of the plurality of images; Determining display positions corresponding to the plurality of images in the target stitching template according to the sorting information of the plurality of images; The multiple pictures are spliced according to the determined display positions to obtain the target picture.
9. The work processing device according to claim 7, characterized in that: The layout determination subunit is configured to determine, for any picture among the multiple pictures, if the aspect ratio of the picture is greater than a preset aspect ratio, the picture layout of the picture as a vertical layout; If the aspect ratio of any of the pictures is equal to the preset aspect ratio, the picture format of any of the pictures is determined to be a square format; If the aspect ratio of any of the images is smaller than the preset aspect ratio, the image layout of any of the images is determined to be a horizontal layout.
10. The work processing device according to claim 7, characterized in that: The template determination subunit is further configured to determine, if there are at least two picture layouts corresponding to the same number of pictures, the splicing template corresponding to the picture layout of the picture with the highest sorting among the pictures corresponding to the at least two picture layouts as the target splicing template.
11. The work processing device according to claim 7, characterized in that: The device also includes: The adjustment unit is configured to execute, if there is at least one to-be-processed picture among the multiple pictures, resizing the at least one to-be-processed picture according to the target aspect ratio corresponding to the target stitching template, and the to-be-processed picture is a picture whose size does not conform to the target stitching template.
12. The work processing device according to claim 11, characterized in that: The target aspect ratio includes a first target aspect ratio and a second target aspect ratio; The adjusting unit is configured to perform proportional scaling on any one of the at least one picture to be processed if the layout information of the picture to be processed is vertical and the aspect ratio of the picture to be processed is greater than or equal to the first target aspect ratio; If the layout information of any of the to-be-processed images is a vertical layout, and the aspect ratio of any of the to-be-processed images is smaller than the first target aspect ratio, center cropping the to-be-processed images; If the layout information of any of the to-be-processed pictures is horizontal, and the aspect ratio of any of the to-be-processed pictures is less than or equal to the first target aspect ratio, scaling the to-be-processed pictures in equal proportions; If the layout information of any of the to-be-processed pictures is horizontal, and the aspect ratio of any of the to-be-processed pictures is greater than the first target aspect ratio, the to-be-processed pictures are centered cropped.
13. The work processing device according to claim 12, characterized in that: The device also includes: The cropping unit is configured to crop any of the images to be processed based on the position of the person in the images to be processed when cropping the images to be processed.
14. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the work processing method as described in any one of claims 1 to 6.
15. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the work processing method as described in any one of claims 1 to 6.
16. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the work processing method according to any one of claims 1 to 6 is implemented.
