A kind of method and system of intercepting photo thumbnail
Technical field
The present invention relates to a kind of method and system of intercepting photo thumbnail, belong to the social networking service field.
Background technology
Existing photo thumbnail, normally comparison film intercepting at random.For the photo of perpendicular version, make the thumbnail that generates in this way, its important information is imperfect, during user's preview photo, is difficult to pick out the actual content of photo.The user then need open the former figure of photo and search if need check certain photo, and this checks that to the user photo has brought inconvenience, has influenced user's experience; In addition; Prior art produces in the method for thumbnail, owing to will consider the composing of picture in the page, and all will be to each pictures through after repeatedly calculating, judge and comparing; Carry out compression and generate the thumbnail dimensions that is fit to page layout; Be saved to server then, the pressure of server increases, and causes the poor stability of server.
Summary of the invention
The objective of the invention is to; A kind of method and system of intercepting photo thumbnail are provided; It can make the complete important information that comprises photo in the thumbnail of generation, when making user's preview photo, can pick out the actual content of photo intuitively; Check that to the user photo has brought convenience, improved user's experience.
For solving the problems of the technologies described above, the present invention adopts following technical scheme: a kind of method of intercepting photo thumbnail may further comprise the steps:
S1, server be according to the difference of photo page displayed type, and user's photo is saved as different address;
The position of the masking-out of the photo in the page that S2, client location user desire to check;
S3, the page type that client is desired to check according to the user obtain corresponding photo address;
S4, client use to cover plate intercepting photo top down 15%~62.5% zone as thumbnail;
S5, during user to access pages, client is checked thumbnail and buffer memory picture according to obtaining photo address.
The method of aforesaid a kind of intercepting photo thumbnail, among the described step S4, client is downloaded photo according to obtaining photo address and is comprised: photo is kept in the buffer memory of client.Photo and thumbnail are kept at the pressure that can alleviate server in the client-cache.
The method of aforesaid a kind of intercepting photo thumbnail, described step S5 also comprises: with the photo location, and make the photo along continuous straight runs placed in the middle.
In the method for aforesaid a kind of intercepting photo thumbnail, described page type comprises: homepage, the former diagram page of photo, photo preview page or the Dynamic Display page.
Realize the system of a kind of intercepting photo thumbnail of preceding method, comprising:
The address generation module is used for the difference of server according to photo page displayed type, and user's photo is saved as different address;
Locating module is used for the position of masking-out of the photo of the page that the client location user desires to check;
Address acquisition module is used for the page type that client desires to check according to the user and obtains corresponding photo address;
Interception module, be used for client use to cover plate intercepting photo top down 15%~62.5% zone as thumbnail;
Display module is used for client and checks thumbnail and buffer memory picture according to obtaining photo address.
The system of aforesaid a kind of intercepting photo thumbnail also comprises the image cache module, is used for photo is kept at the buffer memory of client.
The system of aforesaid a kind of intercepting photo thumbnail also comprises location module placed in the middle, is used for the photo location, and makes the photo along continuous straight runs placed in the middle.
Compared with prior art, the present invention saves as different address through the photo with the user, the position of the masking-out of the photo in the positioning webpage; The page type of desiring to check according to the user obtains corresponding photo address and with its background as masking-out, then the intercepting photo generates thumbnail; The present invention makes the complete important information that comprises photo in the thumbnail of generation, when making user's preview photo, can pick out the actual content of photo intuitively, checks that to the user photo has brought convenience, has improved user's experience; In addition; Comparison film of the present invention is handled in the process that generates thumbnail; Server only need carry out once carrying out relatively afterwards compression with picture and normal width, returns corresponding picture address then, is brought in the adaptation of accomplishing thumbnail by the client; Therefore use method of the present invention can reduce the pressure of server, improve the stability of server.
Description of drawings
Fig. 1 is the system architecture synoptic diagram of a kind of embodiment of the present invention;
Fig. 2 is the workflow diagram of a kind of embodiment of the present invention.
Reference numeral: 1-address generation module, 2-locating module, 3-address acquisition module, 4-display module, 5-interception module, 6-image cache module, 7 location module placed in the middle.
Below in conjunction with accompanying drawing and embodiment the present invention is further described.
Embodiment
Embodiments of the invention: a kind of method of intercepting photo thumbnail may further comprise the steps:
S1, server be according to the difference of photo page displayed type, and user's photo is saved as different address;
The position of the masking-out of the photo in the page that S2, client location user desire to check;
S3, the page type that client is desired to check according to the user obtain corresponding photo address;
S4, client use to cover plate intercepting photo top down 15%~62.5% zone as thumbnail;
S5, during user to access pages, client is checked thumbnail and buffer memory picture according to obtaining photo address.
Among the described step S4, client is downloaded photo according to obtaining photo address and is comprised: photo is kept in the buffer memory of client.
Described step S5 also comprises: with the photo location, and make the photo along continuous straight runs placed in the middle.
Described page type comprises: homepage, the former diagram page of photo, photo preview page or the Dynamic Display page.
Realize the system of a kind of intercepting photo thumbnail of preceding method, its system schematic is as shown in Figure 1; Comprise:
Address generation module 1 is used for the difference of server according to photo page displayed type, and user's photo is saved as different address;
Locating module 2 is used for the position of masking-out of the photo of the page that the client location user desires to check;
Address acquisition module 3 is used for the page type that client desires to check according to the user and obtains corresponding photo address;
Interception module 5, be used for client use to cover plate intercepting photo top down 15%~62.5% zone as thumbnail;
Display module 4 is used for client and checks thumbnail and buffer memory picture according to obtaining photo address.
System also comprises image cache module 6, is used for photo is kept at the buffer memory of client.
System also comprises location module 7 placed in the middle, is used for the photo location, and makes the photo along continuous straight runs placed in the middle.
According to composite principle; Golden section point (approximating 62.5%) is very important in the process of a taking pictures reference point, and the applicant reaches a conclusion after a large amount of photos are analyzed, compare, screened: the key area of most important information of most of photo and photo all is positioned at down 15%~62.5% zone, photo top.
The workflow of a kind of embodiment of the present invention: (workflow diagram is as shown in Figure 2)
S10, picture servers is according to the difference of photo page displayed type, through the address generation module user's photo saved as different address;
S20, the position of the masking-out of the photo in the page that client is desired to check through the locating module consumer positioning;
S30, the page type that client is desired to check according to the user obtain corresponding photo address;
S40, client is photo location, placed in the middle through locating module placed in the middle, then through interception module use cover plate intercepting photo top down 15%~62.5% zone as thumbnail;
S50, during user to access pages, client is checked thumbnail and buffer memory picture according to obtaining photo address through display module.