Disclosure of Invention
The disclosure provides a work processing method, a device, electronic equipment and a storage medium, so as to simplify the operation during browsing works and improve the man-machine interaction efficiency. The technical scheme of the present disclosure is as follows:
according to a first aspect of embodiments of the present disclosure, there is provided a work processing method, the method comprising:
responding to the release operation of the work, and acquiring a plurality of pictures corresponding to the work;
Determining a target splicing template based on the number of pictures and the sizes of the plurality of pictures, wherein the target splicing template is matched with the number and the sizes of the pictures, and the target splicing template is used for limiting the display position of the pictures;
Splicing the plurality of pictures according to the display positions indicated by the target splicing templates to obtain target pictures;
and taking the target picture as a preview picture of the work, and publishing the work to a target server.
When a work is to be released, a plurality of pictures corresponding to the work to be released are obtained, a target splicing template matched with the number and the size of the pictures is determined based on the number and the size of the pictures, the pictures are spliced according to the display position indicated by the target splicing template, the spliced target picture is used as a preview picture of the work to be released, the work is released, after the release of the work is completed, other users can see the preview picture when browsing the work, and therefore all the pictures in the work can be seen at one time without manual operation of the users, the operation is simple and convenient, and the man-machine interaction efficiency is improved.
In some embodiments, the stitching the plurality of pictures according to the display position indicated by the target stitching template, to obtain the target picture includes:
acquiring ordering information of the plurality of pictures based on the target splicing template, wherein the ordering information is used for indicating the display sequence of the plurality of pictures;
Determining the display positions of the plurality of pictures corresponding to the target splicing templates according to the ordering information of the plurality of pictures;
and splicing the plurality of pictures according to the determined display positions to obtain the target picture.
The method comprises the steps of obtaining the ordering information of the plurality of pictures, so that the positions, which are supposed to correspond to each other, of the plurality of pictures in the target template are determined according to the ordering information, and then the plurality of pictures are spliced, so that the pictures which are wanted to be preferentially displayed by a user are displayed at the front positions, and the display effect is improved.
In some embodiments, the determining the target stitching template based on the number of pictures and the size of the plurality of pictures includes:
determining a picture format of each picture in the plurality of pictures based on the aspect ratio of the plurality of pictures;
determining the picture format with the largest number of corresponding pictures as a target picture format;
And determining a target splicing template corresponding to the target picture format and the picture number based on the target picture format and the picture number.
The picture formats of the pictures are determined, so that the target splicing templates are determined according to the picture formats with the largest number of the corresponding pictures, the determined target splicing modules are more in line with the picture formats and the picture numbers of the pictures, and the display effect is improved.
In some embodiments, the determining the picture layout of each of the plurality of pictures based on the aspect ratio of the plurality of pictures comprises:
for any picture in the plurality of pictures, if the aspect ratio of the any picture is larger than the preset aspect ratio, determining the picture format of the any picture as a vertical plate;
If the aspect ratio of any picture is equal to the preset aspect ratio, determining the picture format of any picture as a square plate;
And if the aspect ratio of any picture is smaller than the preset aspect ratio, determining the picture format of any picture as a horizontal plate.
The aspect ratio of each picture is compared with the preset aspect ratio so as to determine the picture format of each picture, so that a proper target splicing template can be determined based on the picture format.
In some embodiments, after determining the picture layout of each of the plurality of pictures based on the aspect ratio of the plurality of pictures, the method further comprises:
If the number of the pictures corresponding to the at least two picture formats is the same, determining a splicing template corresponding to the picture format of the picture which is ranked the forefront among the pictures corresponding to the at least two picture formats as the target splicing template.
When the number of the pictures corresponding to the two picture formats is the same, the splicing templates corresponding to the pictures ranked at the forefront are adopted, and the pictures ranked at the forefront are the pictures which the user wants to show generally, so that the target splicing templates determined based on the pictures ranked at the forefront are more suitable for showing the pictures which the user wants to show most, and the display effect is improved.
In some embodiments, before the splicing the plurality of pictures according to the display positions indicated by the target splicing template to obtain the target picture, the method further includes:
if at least one picture to be processed exists in the plurality of pictures, the at least one picture to be processed is subjected to size adjustment according to the target aspect ratio corresponding to the target splicing template, and the picture to be processed is a picture of which the size does not accord with the target splicing template.
When the pictures to be processed, the sizes of which do not accord with the target splicing templates, exist in the multiple pictures, the sizes of the pictures to be processed are adjusted according to the target aspect ratio corresponding to the target splicing templates, so that each picture accords with the target aspect ratio corresponding to the target splicing templates, and the display effect of each picture is improved.
In some embodiments, the target aspect ratio includes a first target aspect ratio and a second target aspect ratio;
The resizing the at least one picture to be processed according to the target aspect ratio corresponding to the target stitching template includes:
For any one of the at least one picture to be processed, if the format information of the any one picture to be processed is a vertical version and the aspect ratio of the any one picture to be processed is greater than or equal to the first target aspect ratio, scaling the any one picture to be processed in an equal proportion;
if the format information of any picture to be processed is a vertical version and the aspect ratio of the any picture to be processed is smaller than the first target aspect ratio, carrying out centered cutting on the any picture to be processed;
If the format information of any picture to be processed is a horizontal version and the aspect ratio of the any picture to be processed is smaller than or equal to the first target aspect ratio, scaling the any picture to be processed in an equal proportion;
if the layout information of any picture to be processed is a horizontal version and the aspect ratio of the any picture to be processed is larger than the first target aspect ratio, performing centered clipping on the any picture to be processed.
When the aspect ratio of the picture does not meet the requirement, the picture is scaled equally or cut centrally by adopting a size adjustment mode corresponding to the aspect ratio of the picture, so that the picture is more suitable for a target splicing template, and the display effect is further improved.
In some embodiments, the method further comprises:
And when any picture to be processed is cut, cutting the picture to be processed based on the position of the person in the picture to be processed.
By clipping the picture based on the positions of the persons in the picture, the clipped picture can still completely comprise the persons in the picture, and the display effect is improved.
According to a second aspect of embodiments of the present disclosure, there is provided a work processing apparatus, the apparatus comprising:
an acquisition unit configured to perform an operation of acquiring a plurality of pictures corresponding to a work in response to a release of the work;
A determining unit configured to perform determining a target stitching template based on the number of pictures and the sizes of the plurality of pictures, the target stitching template being matched with the number of pictures and the sizes, the target stitching template being used to define a display position of the pictures;
The splicing unit is configured to splice the plurality of pictures according to the display positions indicated by the target splicing template to obtain target pictures;
and the issuing unit is configured to execute the target picture as a preview picture of the work and issue the work to a target server.
In some embodiments, the stitching unit is configured to perform obtaining ordering information of the plurality of pictures based on the target stitching template, the ordering information being used to indicate a display order of the plurality of pictures; determining the display positions of the plurality of pictures corresponding to the target splicing templates according to the ordering information of the plurality of pictures; and splicing the plurality of pictures according to the determined display positions to obtain the target picture.
In some embodiments, the determination unit includes a layout determination subunit and a template determination subunit;
the format determining subunit is configured to determine a picture format of each picture in the plurality of pictures based on the aspect ratio of the plurality of pictures;
the format determining subunit is further configured to determine the picture format with the largest number of corresponding pictures as a target picture format;
the template determination subunit is configured to determine a target stitching template corresponding to the target picture layout and the picture number based on the target picture layout and the picture number.
In some embodiments, the layout determining subunit is configured to perform, for any picture of the plurality of pictures, determining a picture layout of the any picture as a portrait if an aspect ratio of the any picture is greater than a preset aspect ratio; if the aspect ratio of any picture is equal to the preset aspect ratio, determining the picture format of any picture as a square plate; and if the aspect ratio of any picture is smaller than the preset aspect ratio, determining the picture format of any picture as a horizontal plate.
In some embodiments, the template determining subunit is further configured to execute, if there are at least two pictures corresponding to the same number of pictures, determining, as the target splicing template, a splicing template corresponding to a picture format of a picture ranked furthest forward from among pictures corresponding to the at least two picture formats.
In some embodiments, the apparatus further comprises:
And the adjusting unit is configured to execute the size adjustment of at least one picture to be processed according to the target aspect ratio corresponding to the target splicing template if at least one picture to be processed exists in the plurality of pictures, wherein the picture to be processed is a picture of which the size does not accord with the target splicing template.
In some embodiments, the target aspect ratio includes a first target aspect ratio and a second target aspect ratio;
The adjusting unit is configured to execute any one of the at least one picture to be processed, and if the format information of the any one picture to be processed is a vertical version and the aspect ratio of the any one picture to be processed is greater than or equal to the first target aspect ratio, the any one picture to be processed is scaled in an equal proportion; if the format information of any picture to be processed is a vertical version and the aspect ratio of the any picture to be processed is smaller than the first target aspect ratio, carrying out centered cutting on the any picture to be processed; if the format information of any picture to be processed is a horizontal version and the aspect ratio of the any picture to be processed is smaller than or equal to the first target aspect ratio, scaling the any picture to be processed in an equal proportion; if the layout information of any picture to be processed is a horizontal version and the aspect ratio of the any picture to be processed is larger than the first target aspect ratio, performing centered clipping on the any picture to be processed.
In some embodiments, the apparatus further comprises:
And the clipping unit is configured to clip any picture to be processed based on the figure position in the any picture to be processed when clipping the any picture to be processed.
According to a third aspect of embodiments of the present disclosure, there is provided an electronic device, comprising:
A processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the work processing method described above.
According to a fourth aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium, which when executed by a processor of an electronic device, causes the electronic device to perform the above-described work processing method.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the above-described work processing method.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Detailed Description
In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the foregoing figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the disclosure described herein may be capable of operation in sequences other than those illustrated or described herein. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the accompanying claims.
The user information referred to in the present disclosure may be information authorized by the user or sufficiently authorized by each party.
FIG. 1 is a schematic diagram of an implementation environment of a work processing method, according to an exemplary embodiment, and referring to FIG. 1, the implementation environment specifically includes: an electronic device 101 and a server 102.
The electronic device 101 may be at least one of a smart phone, a smart watch, a portable computer, an MP3 player (Moving Picture Experts Group Audio Layer III, dynamic video expert compression standard audio plane 3), an MP4 (Moving Pi cture Experts Group Audio Layer IV, dynamic video expert compression standard audio plane 4) player, and a laptop portable computer. The electronic device 101 is connected to the server 102 by wired or wireless communication, which is not limited by the embodiments of the present disclosure. The electronic device 101 stores therein a plurality of pictures so that a user selects a picture to be presented from among the plurality of pictures. In response to a selection operation by the user, the electronic device 101 uses the selected picture as a picture corresponding to the work to be published, and then sends the pictures to the server 102.
The electronic device 101 may refer broadly to one of a plurality of electronic devices, with the present embodiment being illustrated only by the electronic device 101. Those skilled in the art will recognize that the number of terminals may be greater or lesser. The number of the electronic devices may be only a few, or the number of the electronic devices may be tens or hundreds, or more, and the number and the device type of the electronic devices are not limited in the embodiments of the present disclosure.
Server 102 may be at least one of a server, a plurality of servers, a cloud server, a cloud computing platform, and a virtualization center. The server 102 is connected to the electronic device 101 by wired or wireless communication, which is not limited by the embodiment of the present disclosure. The server 102 receives the plurality of pictures sent by the electronic device 101, and then issues works corresponding to the plurality of pictures, so that other electronic devices corresponding to other users can acquire works corresponding to the plurality of pictures to be displayed. Alternatively, the number of servers may be greater or lesser, which is not limited by the embodiments of the present disclosure. Of course, the server 102 may also include other functional servers to provide more comprehensive and diverse services.
FIG. 2 is a flowchart illustrating a method of processing a work, according to an exemplary embodiment, and referring to FIG. 2, the specific steps include:
In step S201, in response to a release operation on a work, an electronic device acquires a plurality of pictures corresponding to the work.
In step S202, the electronic device determines a target stitching template based on the number of pictures and the sizes of the plurality of pictures, where the target stitching template matches the number and the sizes of the pictures, and the target stitching template is used to define a display position of the pictures.
In step S203, the electronic device splices the plurality of pictures according to the display positions indicated by the target splicing template, so as to obtain a target picture.
In step S204, the electronic device issues the work to the target server with the target picture as a preview picture of the work.
According to the scheme provided by the embodiment of the disclosure, when the work is to be released, a plurality of pictures corresponding to the work to be released are acquired, based on the number and the size of the pictures, a target splicing template matched with the number and the size of the pictures is determined, then the pictures are spliced according to the display position indicated by the target splicing template, the spliced target picture is used as a preview picture of the work to be released, and the work is released.
In some embodiments, the stitching the plurality of pictures according to the display position indicated by the target stitching template, to obtain the target picture includes:
acquiring ordering information of the plurality of pictures based on the target splicing template, wherein the ordering information is used for indicating the display sequence of the plurality of pictures;
Determining the display positions of the plurality of pictures corresponding to the target splicing templates according to the ordering information of the plurality of pictures;
and splicing the plurality of pictures according to the determined display positions to obtain the target picture.
In some embodiments, the determining the target stitching template based on the number of pictures and the size of the plurality of pictures includes:
determining a picture format of each picture in the plurality of pictures based on the aspect ratio of the plurality of pictures;
determining the picture format with the largest number of corresponding pictures as a target picture format;
And determining a target splicing template corresponding to the target picture format and the picture number based on the target picture format and the picture number.
In some embodiments, the determining the picture layout of each of the plurality of pictures based on the aspect ratio of the plurality of pictures comprises:
for any picture in the plurality of pictures, if the aspect ratio of the any picture is larger than the preset aspect ratio, determining the picture format of the any picture as a vertical plate;
If the aspect ratio of any picture is equal to the preset aspect ratio, determining the picture format of any picture as a square plate;
And if the aspect ratio of any picture is smaller than the preset aspect ratio, determining the picture format of any picture as a horizontal plate.
In some embodiments, after determining the picture layout of each of the plurality of pictures based on the aspect ratio of the plurality of pictures, the method further comprises:
If the number of the pictures corresponding to the at least two picture formats is the same, determining a splicing template corresponding to the picture format of the picture which is ranked the forefront among the pictures corresponding to the at least two picture formats as the target splicing template.
In some embodiments, before the splicing the plurality of pictures according to the display positions indicated by the target splicing template to obtain the target picture, the method further includes:
if at least one picture to be processed exists in the plurality of pictures, the at least one picture to be processed is subjected to size adjustment according to the target aspect ratio corresponding to the target splicing template, and the picture to be processed is a picture of which the size does not accord with the target splicing template.
In some embodiments, the target aspect ratio includes a first target aspect ratio and a second target aspect ratio;
The resizing the at least one picture to be processed according to the target aspect ratio corresponding to the target stitching template includes:
For any one of the at least one picture to be processed, if the picture format of the any one picture to be processed is a vertical version and the aspect ratio of the any one picture to be processed is greater than or equal to the first target aspect ratio, scaling the any one picture to be processed in an equal proportion;
If the picture format of any picture to be processed is a vertical version and the aspect ratio of the any picture to be processed is smaller than the first target aspect ratio, carrying out centering cutting on the any picture to be processed;
if the picture format of any picture to be processed is a horizontal version and the aspect ratio of the any picture to be processed is smaller than or equal to the first target aspect ratio, scaling the any picture to be processed in an equal proportion;
if the picture format of any picture to be processed is a horizontal plate and the aspect ratio of any picture to be processed is larger than the first target aspect ratio, performing centered clipping on any picture to be processed.
In some embodiments, the method further comprises:
And when any picture to be processed is cut, cutting the picture to be processed based on the position of the person in the picture to be processed.
FIG. 3 is a flowchart illustrating a method of processing a work, according to an exemplary embodiment, see FIG. 3, comprising the specific steps of:
In step S301, the electronic device acquires a plurality of pictures corresponding to a work in response to a release operation on the work.
It should be noted that, the electronic device stores a plurality of pictures in advance, and displays the pictures, and each picture corresponds to a corresponding checking control, so that a user can select from the pictures by triggering the checking control corresponding to each picture, and the user triggers the release control after the selection is completed. The electronic equipment responds to the triggering operation of the user and acquires a plurality of pictures selected by the user as a plurality of pictures corresponding to the work to be released.
In step S302, the electronic device determines a picture layout of each of the plurality of pictures based on the aspect ratio of the plurality of pictures.
It should be noted that, the aspect ratio of a picture is the ratio of the width to the height of the picture, and when determining the width and the height of the picture, the directions of the width and the height may be different under different usage scenarios. Taking the electronic equipment as an example of the smart phone, if the smart phone is in a vertical screen state, the width of the picture is the side parallel to the upper side and the lower side of the screen of the smart phone, and the height of the picture is the side parallel to the left side and the right side of the screen of the smart phone; if the smart phone is in the horizontal screen state, the width of the picture is the side parallel to the left side and the right side of the screen of the smart phone, and the height of the picture is the side parallel to the upper side and the lower side of the screen of the smart phone. Taking an electronic device as a desktop computer as an example, the width of a picture is a side parallel to the upper side and the lower side of a screen of the desktop computer, and the height of the picture is a side parallel to the left side and the right side of the screen of the desktop computer.
In some embodiments, when determining the picture format of any one of the plurality of pictures, the electronic device determines an aspect ratio of the any one of the pictures based on the size of the any one of the pictures, and further compares the aspect ratio of the any one of the pictures with a preset aspect ratio to determine the picture format of the any one of the pictures.
It should be noted that, by comparing the aspect ratio of each picture with the preset aspect ratio, the picture layout of each picture is determined. For any picture in the plurality of pictures, if the aspect ratio of the any picture is larger than the preset aspect ratio, determining the picture format of the any picture as a vertical plate; if the aspect ratio of any picture is equal to the preset aspect ratio, determining the picture format of any picture as a square plate; and if the aspect ratio of any picture is smaller than the preset aspect ratio, determining the picture format of any picture as a horizontal plate. Wherein the preset aspect ratio is 1.
That is, assuming that the height of any picture is a and the width is b, when a > b, the picture format of any picture is vertical; when a=b, the picture format of any picture is a square; when a < b, the picture format of any picture is a horizontal edition. Wherein a and b are any positive values, which are not limited by the embodiments of the present disclosure.
It should be noted that, the parameter in the foregoing process is a, and the parameter is b, which is only an exemplary illustration, and in some embodiments, the parameter can be replaced by replacing the parameter, which is not limited by the embodiments of the disclosure.
In step S303, the electronic device determines the picture format with the largest number of corresponding pictures as the target picture format.
In step S304, the electronic device determines, based on the target picture layout and the number of pictures, a target stitching template corresponding to the target picture layout and the number of pictures, where the target stitching template is used to define a display position of the pictures.
It should be noted that, referring to fig. 4, fig. 4 is a schematic diagram of a stitching template according to an exemplary embodiment, where the stitching template corresponds to each picture format and different numbers of pictures.
For example, when the picture formats of the plurality of pictures are all vertical plates, a splicing template shown in the first column in fig. 4, that is, a vertical plate splicing template is adopted; when the picture formats of the plurality of pictures are square plates, a splicing template shown in the second column in fig. 4, namely a square plate splicing template is adopted; when the picture formats of the plurality of pictures are all horizontal plates, the splicing templates shown in the third column in fig. 4 are adopted, namely the horizontal plate splicing templates. When the plurality of pictures correspond to at least two picture formats, adopting picture formats with the number of corresponding pictures being greater than that of pictures corresponding to other picture formats, namely, when the number of pictures corresponding to the vertical plates is greater than that of pictures corresponding to other picture formats, adopting a splicing template shown in a first column in fig. 4, namely, a vertical plate splicing template; when the number of the pictures corresponding to the square plate is more than the number of the pictures corresponding to other picture formats, adopting a splicing template shown in a second column in fig. 4, namely the square plate splicing template; when the number of pictures corresponding to the horizontal plate is greater than the number of pictures corresponding to other picture formats, a splicing template shown in the third column in fig. 4, namely, a horizontal plate splicing template is adopted.
The picture formats of the pictures are determined through the steps 302 to 304, so that the determination of the target splicing module is performed according to the picture formats with the largest number of the corresponding pictures, the determined target splicing module is more consistent with the picture formats and the picture numbers of the pictures, and the display effect is further improved.
In some embodiments, the electronic device acquires, while acquiring the plurality of pictures, ordering information of the plurality of pictures, that is, an order in which the plurality of pictures are checked, where the ordering information is used to indicate a display order of the plurality of pictures. If the number of the pictures corresponding to the at least two picture formats is the same, determining a splicing template corresponding to the picture format of the picture with the minimum ordering information in the pictures corresponding to the at least two picture formats as the target splicing template.
That is, when two picture formats or the number of pictures corresponding to three picture formats is the same, a splicing template corresponding to the picture format of the picture with the front picture ordering information is adopted as the target splicing template. For example, when the number of pictures corresponding to the vertical plates and the horizontal plates is the same, and the picture format corresponding to the picture with the ordering information of 1 is the vertical plate, a splicing template shown in the first column in fig. 4, that is, a vertical splicing template is adopted; when the number of pictures corresponding to the vertical plates and the horizontal plates is the same, and the picture format corresponding to the picture with the ordering information of 1 is the square plate, and the picture format corresponding to the picture with the ordering information of 2 is the vertical plate, a splicing template shown in the first column in fig. 4, namely, a vertical splicing template is adopted.
When the number of the pictures corresponding to the two picture formats is the same, the splicing module corresponding to the picture ranked at the forefront is adopted, and because the picture ranked at the forefront is the picture which is generally the picture which is the most wanted to be displayed by the user, the target splicing template determined based on the picture ranked at the forefront is more suitable for displaying the picture which is the most wanted to be displayed by the user, so that the display effect is improved.
It should be noted that the above-described splicing templates shown in fig. 4 are only some exemplary splicing templates, and in some embodiments, the splicing templates include other types, and the specific types of splicing templates are not limited in the embodiments of the present disclosure.
In step S305, the electronic device splices the plurality of pictures according to the display positions indicated by the target splicing template, so as to obtain the target picture.
In some embodiments, the electronic device adds the plurality of pictures to the target stitching template according to the display position indicated by the target stitching template, so as to stitch the plurality of pictures, and further obtain the target picture.
It should be noted that, the above process is described by taking the random splicing of the plurality of pictures as an example, in other embodiments, the electronic device determines, according to the sorting information of the plurality of pictures, a display position corresponding to the plurality of pictures in the target splicing template, and splices the plurality of pictures according to the determined display position. That is, each display position in the target splicing template corresponds to corresponding position information, and the position information is used for indicating a label corresponding to each display position, so that according to the corresponding relation between the ordering information and the label, the display position corresponding to the plurality of pictures in the target splicing template is determined, and then the splicing of the plurality of pictures is realized.
For example, for a work to be published including 3 pictures, if the picture formats corresponding to the 3 pictures are all vertical, determining the 3 rd type of the vertical splicing template shown in the first column in fig. 4 as the target splicing template, determining the display position of the picture with the ordering information of 1 in the target splicing template as the display position of the left side in the target splicing template according to the ordering information of the 3 pictures, determining the display position of the picture with the ordering information of 2 in the target splicing template as the display position of the right half part in the target splicing template, and determining the display position of the picture with the ordering information of 3 in the target splicing template as the display position of the right lower half part in the target splicing template, thereby realizing the splicing of the 3 pictures.
The method comprises the steps of obtaining the ordering information of the plurality of pictures, so that the positions, which are supposed to correspond to each other, of the plurality of pictures in the target template are determined according to the ordering information, and then the plurality of pictures are spliced, so that the pictures which are wanted to be preferentially displayed by a user are displayed at the front positions, and the display effect is improved.
In some embodiments, the electronic device detects an aspect ratio of the plurality of pictures, and if at least one picture to be processed exists in the plurality of pictures, the electronic device adjusts a size of the at least one picture to be processed according to a target aspect ratio corresponding to the target stitching template, where the size of the picture to be processed is not in accordance with the target stitching template. When the pictures with the sizes not conforming to the target splicing templates exist in the multiple pictures, the pictures are subjected to size adjustment according to the target aspect ratio corresponding to the target splicing templates, so that each picture conforms to the target aspect ratio corresponding to the target splicing templates, and the display effect of each picture is improved.
The target aspect ratio comprises a first target aspect ratio and a second target aspect ratio, wherein the first target aspect ratio is a target aspect ratio corresponding to a picture with a picture format of a vertical plate, and the second target aspect ratio is a target aspect ratio corresponding to a picture with a picture format of a horizontal plate. For any one of the at least one picture to be processed, if the picture format of the any one picture to be processed is a vertical version and the aspect ratio of the any one picture to be processed is greater than or equal to the first target aspect ratio, scaling the any one picture to be processed in an equal proportion; if the picture format of any picture to be processed is a vertical version and the aspect ratio of the any picture to be processed is smaller than the first target aspect ratio, carrying out centering cutting on the any picture to be processed; if the picture format of any picture to be processed is a horizontal version and the aspect ratio of the any picture to be processed is smaller than or equal to the first target aspect ratio, scaling the any picture to be processed in an equal proportion; if the picture format of any picture to be processed is a horizontal plate and the aspect ratio of any picture to be processed is larger than the first target aspect ratio, performing centered clipping on any picture to be processed. When the aspect ratio of the picture does not meet the requirement, the picture is scaled equally or cut centrally by adopting a size adjustment mode corresponding to the aspect ratio of the picture, so that the picture is more suitable for a target splicing template, and the display effect is further improved.
Wherein 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 specific values of the first target aspect ratio and the second target aspect ratio are not limited in the embodiments of the present disclosure. The following description will take the example that the first target aspect ratio is 1:2 and the second target aspect ratio is 16:9:
still assume that the height of any picture to be processed is a and the width is b, if the picture format of any picture to be processed is a vertical plate, scaling the any picture to be processed in equal proportion when (a: b) < 16:9; when (a: b) >16:9, centered cropping is performed on any of the pictures to be processed. If the picture format of any picture to be processed is a horizontal version, scaling the picture to be processed in equal proportion when (a: b) < 1:2; and when (a: b) >1:2, centering and clipping any picture to be processed.
It should be noted that, when any one of the pictures to be processed is cut, the any one of the pictures to be processed is cut based on the position of the person in the any one of the pictures to be processed. By clipping the picture based on the positions of the persons in the picture, the clipped picture can still completely comprise the persons in the picture, and the display effect is improved.
In some embodiments, the electronic device identifies a person position in the any one of the to-be-processed pictures, and then uses the person position as a center point to clip the any one of the to-be-processed pictures, so as to ensure that the clipped to-be-processed picture is centered on the person, and improve the display effect of the any one of the to-be-processed pictures.
Through the steps 303 to 304, the target splicing templates adopted when the pictures are spliced can be determined based on the number and the size of the pictures, so that the pictures are spliced according to the display positions indicated by the target splicing templates, further the target pictures for display are obtained, the target pictures comprise a plurality of pictures, all the released pictures can be seen at one time, manual operation is not needed by a user, the operation is simple and convenient, and the man-machine interaction efficiency is improved.
In step S306, the electronic device issues the work to the target server with the target picture as a preview picture of the work.
After the work is released, other users can acquire the work through the corresponding electronic equipment, and then the work is displayed. When the work is displayed, the preview picture, namely the target picture, of the work is displayed, other users can slide in the interface for displaying the target picture, and the electronic equipment corresponding to the user responds to the sliding operation of the user to display the pictures one by one.
And when the pictures are displayed one by one, displaying the pictures according to the ordering information of the pictures. In some embodiments, the plurality of pictures are presented in other manners, which are not limited by the embodiments of the present disclosure.
According to the scheme provided by the embodiment of the disclosure, when the work is to be released, a plurality of pictures corresponding to the work to be released are acquired, based on the number and the size of the pictures, a target splicing template matched with the number and the size of the pictures is determined, then the pictures are spliced according to the display position indicated by the target splicing template, the spliced target picture is used as a preview picture of the work to be released, and the work is released, so that after the release of the work is completed, other users can see the preview picture when browsing the work, and therefore all the pictures in the work can be seen at one time, manual operation of the users is not needed, the operation is simple and convenient, and the man-machine interaction efficiency is improved. For a work to be released, which contains a plurality of pictures, when the pictures are aggregated, that is, the pictures are spliced, the pictures are subjected to size adjustment according to the sizes of the pictures, for example, corresponding positions are cut out, so that the pictures are spliced into an optimal display mode, the thumbnail display of the pictures is more attractive, and the display effect of the pictures is improved.
Fig. 5 is a block diagram of a work processing apparatus, according to an exemplary embodiment, see fig. 5, comprising:
an obtaining unit 501 configured to perform a process of obtaining a plurality of pictures corresponding to a work in response to a release operation on the work;
A determining unit 502 configured to perform determining a target stitching template based on the number of pictures and the sizes of the plurality of pictures, the target stitching template being matched with the number of pictures and the sizes, the target stitching template being used to define a display position of the pictures;
A stitching unit 503, configured to stitch the multiple pictures according to the display positions indicated by the target stitching template, so as to obtain a target picture;
and a distribution unit 504 configured to execute distribution of the work to a target server with the target picture as a preview picture of the work.
According to the device provided by the embodiment of the disclosure, when the work is to be released, the plurality of pictures corresponding to the work to be released are obtained, the target splicing templates matched with the number and the size of the pictures are determined based on the number and the size of the pictures of the plurality of pictures, then the plurality of pictures are spliced according to the display positions indicated by the target splicing templates, the spliced target pictures are used as preview pictures of the work to be released, and the work is released.
In some embodiments, the stitching unit 503 is configured to perform obtaining ordering information of the plurality of pictures based on the target stitching template, where the ordering information is used to indicate a display order of the plurality of pictures; determining the display positions of the plurality of pictures corresponding to the target splicing templates according to the ordering information of the plurality of pictures; and splicing the plurality of pictures according to the determined display positions to obtain the target picture.
In some embodiments, the determination unit 502 includes a layout determination subunit and a template determination subunit;
the format determining subunit is configured to determine a picture format of each picture in the plurality of pictures based on the aspect ratio of the plurality of pictures;
the format determining subunit is further configured to determine the picture format with the largest number of corresponding pictures as a target picture format;
the template determination subunit is configured to determine a target stitching template corresponding to the target picture layout and the picture number based on the target picture layout and the picture number.
In some embodiments, the layout determining subunit is configured to perform, for any picture of the plurality of pictures, determining a picture layout of the any picture as a portrait if an aspect ratio of the any picture is greater than a preset aspect ratio; if the aspect ratio of any picture is equal to the preset aspect ratio, determining the picture format of any picture as a square plate; and if the aspect ratio of any picture is smaller than the preset aspect ratio, determining the picture format of any picture as a horizontal plate.
In some embodiments, the template determining subunit is further configured to execute, if there are at least two pictures corresponding to the same number of pictures, determining, as the target splicing template, a splicing template corresponding to a picture format of a picture ranked furthest forward from among pictures corresponding to the at least two picture formats.
In some embodiments, the apparatus further comprises:
And the adjusting unit is configured to execute the size adjustment of at least one picture to be processed according to the target aspect ratio corresponding to the target splicing template if at least one picture to be processed exists in the plurality of pictures, wherein the picture to be processed is a picture of which the size does not accord with the target splicing template.
In some embodiments, the target aspect ratio includes a first target aspect ratio and a second target aspect ratio;
The adjusting unit is configured to execute any one of the at least one picture to be processed, and if the format information of the any one picture to be processed is a vertical version and the aspect ratio of the any one picture to be processed is greater than or equal to the first target aspect ratio, the any one picture to be processed is scaled in an equal proportion; if the format information of any picture to be processed is a vertical version and the aspect ratio of the any picture to be processed is smaller than the first target aspect ratio, carrying out centered cutting on the any picture to be processed; if the format information of any picture to be processed is a horizontal version and the aspect ratio of the any picture to be processed is smaller than or equal to the first target aspect ratio, scaling the any picture to be processed in an equal proportion; if the layout information of any picture to be processed is a horizontal version and the aspect ratio of the any picture to be processed is larger than the first target aspect ratio, performing centered clipping on the any picture to be processed.
In some embodiments, the apparatus further comprises:
And the clipping unit is configured to clip any picture to be processed based on the figure position in the any picture to be processed when clipping the any picture to be processed.
Fig. 6 is a block diagram of an electronic device 600, according to an example embodiment. The electronic device 600 may be: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III, motion picture expert compression standard audio plane 3), an MP4 (Moving Picture Experts Group Audio Layer I V, motion picture expert compression standard audio plane 4) player, a notebook computer, or a desktop computer. Electronic device 600 may also be referred to by other names of user devices, portable electronic devices, laptop electronic devices, desktop electronic devices, and the like.
In general, the electronic device 600 includes: one or more processors 601 and one or more memories 602.
Processor 601 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 601 may be implemented in at least one hardware form of DSP (DIGITAL SIGNAL Processing), FPGA (Field-Progra mmable GATE ARRAY, field programmable gate array), PLA (Programmable Logic Array ). Processor 601 may also include a main processor, which is a processor for processing data in an awake state, also referred to as a CPU (Central Processing Unit ), and a coprocessor; a coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 601 may integrate a GPU (Graphics Processing Unit, image processor) for rendering and drawing of content required to be displayed by the display screen. In some embodiments, the processor 601 may also include an AI (ARTIFICIAL INTELLIGENCE ) processor for processing computing operations related to machine learning.
The memory 602 may include one or more computer-readable storage media, which may be non-transitory. The memory 602 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in memory 602 is used to store at least one program code for execution by processor 601 to implement the work processing methods provided by the method embodiments of the present disclosure.
In some embodiments, the electronic device 600 may further optionally include: a peripheral interface 603, and at least one peripheral. The processor 601, memory 602, and peripheral interface 603 may be connected by a bus or signal line. The individual peripheral devices may be connected to the peripheral device interface 603 via buses, signal lines or a circuit board. Specifically, the peripheral device includes: at least one of radio frequency circuitry 604, a display 605, a camera 606, audio circuitry 607, a positioning component 608, and a power supply 609.
Peripheral interface 603 may be used to connect at least one Input/Output (I/O) related peripheral to processor 601 and memory 602. In some embodiments, the processor 601, memory 602, and peripheral interface 603 are integrated on the same chip or circuit board; in some other embodiments, either or both of the processor 601, memory 602, and peripheral interface 603 may be implemented on separate chips or circuit boards, which is not limited in this embodiment.
The Radio Frequency circuit 604 is configured to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 604 communicates with a communication network and other communication devices via electromagnetic signals. The radio frequency circuit 604 converts an electrical signal into an electromagnetic signal for transmission, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 604 includes: antenna systems, RF transceivers, one or more amplifiers, tuners, oscillators, digital signal processors, codec chipsets, subscriber identity module cards, and so forth. The radio frequency circuitry 604 may communicate with other electronic devices via at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: metropolitan area networks, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and/or WiFi (WIRELESS FIDELITY ) networks. In some embodiments, the radio frequency circuitry 604 may also include NFC (NEAR FIELD Communication) related circuitry, which is not limited by the present disclosure.
The display screen 605 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display 605 is a touch display, the display 605 also has the ability to collect touch signals at or above the surface of the display 605. The touch signal may be input as a control signal to the processor 601 for processing. At this point, the display 605 may also be used to provide virtual buttons and/or virtual keyboards, also referred to as soft buttons and/or soft keyboards. In some embodiments, the display 605 may be one, providing a front panel of the electronic device 600; in other embodiments, the display screen 605 may be at least two, respectively disposed on different surfaces of the electronic device 600 or in a folded design; in still other embodiments, the display 605 may be a flexible display disposed on a curved surface or a folded surface of the electronic device 600. Even more, the display 605 may be arranged in a non-rectangular irregular pattern, i.e., a shaped screen. The display 605 may be made of LCD (Liquid CRYSTAL DISPLAY ), OLED (Organic Light-Em itting Diode, organic Light-emitting diode) or other materials.
The camera assembly 606 is used to capture images or video. Optionally, the camera assembly 606 includes a front camera and a rear camera. In general, a front camera is disposed on a front panel of an electronic device, and a rear camera is disposed on a rear surface of the electronic device. In some embodiments, the at least two rear cameras are any one of a main camera, a depth camera, a wide-angle camera and a tele camera, so as to realize that the main camera and the depth camera are fused to realize a background blurring function, and the main camera and the wide-angle camera are fused to realize a panoramic shooting and Virtual Reality (VR) shooting function or other fusion shooting functions. In some embodiments, camera assembly 606 may also include a flash. The flash lamp can be a single-color temperature flash lamp or a double-color temperature flash lamp. The dual-color temperature flash lamp refers to a combination of a warm light flash lamp and a cold light flash lamp, and can be used for light compensation under different color temperatures.
The audio circuit 607 may include a microphone and a speaker. The microphone is used for collecting sound waves of users and environments, converting the sound waves into electric signals, and inputting the electric signals to the processor 601 for processing, or inputting the electric signals to the radio frequency circuit 604 for voice communication. For purposes of stereo acquisition or noise reduction, the microphone may be multiple and separately disposed at different locations of the electronic device 600. The microphone may also be an array microphone or an omni-directional pickup microphone. The speaker is used to convert electrical signals from the processor 601 or the radio frequency circuit 604 into sound waves. The speaker may be a conventional thin film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, not only the electric signal can be converted into a sound wave audible to humans, but also the electric signal can be converted into a sound wave inaudible to humans for ranging and other purposes. In some embodiments, the audio circuit 607 may also include a headphone jack.
The Location component 608 is used to locate the current geographic Location of the electronic device 600 to enable navigation or LBS (Location B ASED SERVICE, location-based service). The positioning component 608 may be a positioning component based on the United states GPS (Global Positioni ng System ), the Beidou system of China, the Granati system of Russia, or the Galileo system of the European Union.
The power supply 609 is used to power the various components in the electronic device 600. The power source 609 may be alternating current, direct current, disposable battery or rechargeable battery. When the power source 609 includes a rechargeable battery, the rechargeable battery may support wired or wireless charging. The rechargeable battery may also be used to support fast charge technology.
In some embodiments, the electronic device 600 further includes one or more sensors 610. The one or more sensors 610 include, but are not limited to: acceleration sensor 611, gyroscope sensor 612, pressure sensor 613, fingerprint sensor 614, optical sensor 615, and proximity sensor 616.
The acceleration sensor 611 can detect the magnitudes of accelerations on three coordinate axes of the coordinate system established with the electronic device 600. For example, the acceleration sensor 611 may be used to detect components of gravitational acceleration in three coordinate axes. The processor 601 may control the display screen 605 to display the user interface in a landscape view or a portrait view according to the gravitational acceleration signal acquired by the acceleration sensor 611. The acceleration sensor 611 may also be used for the acquisition of motion data of a game or a user.
The gyro sensor 612 may detect a body direction and a rotation angle of the electronic device 600, and the gyro sensor 612 may cooperate with the acceleration sensor 611 to collect a 3D motion of the user on the electronic device 600. The processor 601 may implement the following functions based on the data collected by the gyro sensor 612: motion sensing (e.g., changing UI according to a tilting operation by a user), image stabilization at shooting, game control, and inertial navigation.
The pressure sensor 613 may be disposed at a side frame of the electronic device 600 and/or at an underlying layer of the display 605. When the pressure sensor 613 is disposed on a side frame of the electronic device 600, a grip signal of the user on the electronic device 600 may be detected, and the processor 601 performs a left-right hand recognition or a shortcut operation according to the grip signal collected by the pressure sensor 613. When the pressure sensor 613 is disposed at the lower layer of the display screen 605, the processor 601 controls the operability control on the UI interface according to the pressure operation of the user 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.
The fingerprint sensor 614 is used to collect a fingerprint of a user, and the processor 601 identifies the identity of the user based on the fingerprint collected by the fingerprint sensor 614, or the fingerprint sensor 614 identifies the identity of the user based on the collected fingerprint. Upon recognizing that the user's identity is a trusted identity, the processor 601 authorizes the user to perform relevant sensitive operations including unlocking the screen, viewing encrypted information, downloading software, paying for and changing settings, etc. The fingerprint sensor 614 may be provided on the front, back, or side of the electronic device 600. When a physical key or vendor Logo is provided on the electronic device 600, the fingerprint sensor 614 may be integrated with the physical key or vendor Logo.
The optical sensor 615 is used to collect ambient light intensity. In one embodiment, processor 601 may control the display brightness of display 605 based on the intensity of ambient light collected by optical sensor 615. Specifically, when the intensity of the ambient light is high, the display brightness of the display screen 605 is turned up; when the ambient light intensity is low, the display brightness of the display screen 605 is turned down. In another embodiment, the processor 601 may also dynamically adjust the shooting parameters of the camera assembly 606 based on the ambient light intensity collected by the optical sensor 615.
A proximity sensor 616, also referred to as a distance sensor, is typically provided on the front panel of the electronic device 600. The proximity sensor 616 is used to capture the distance between the user and the front of the electronic device 600. In one embodiment, when the proximity sensor 616 detects a gradual decrease in the distance between the user and the front of the electronic device 600, the processor 601 controls the display 605 to switch from the bright screen state to the off screen state; when the proximity sensor 616 detects that the distance between the user and the front of the electronic device 600 gradually increases, the processor 601 controls the display screen 605 to switch from the off-screen state to the on-screen state.
Those skilled in the art will appreciate that the structure shown in fig. 6 is not limiting of the electronic device 600 and may include more or fewer components than shown, or may combine certain components, or may employ a different arrangement of components.
In an exemplary embodiment, a computer readable storage medium is also provided, such as a memory 602, including instructions executable by the processor 601 of the electronic device 600 to perform the above-described work processing method. Alternatively, the computer readable storage medium may be a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a compact disc Read-Only Memory (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, a computer program product is also provided, comprising a computer program executable by the processor 601 of the electronic device for performing the method steps of the work processing method provided in the above embodiments.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any adaptations, uses, or adaptations of the disclosure following the general principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.