U.S. patent application number 14/161684 was filed with the patent office on 2014-09-18 for automatic display of resized images.
This patent application is currently assigned to Google Inc.. The applicant listed for this patent is Google Inc.. Invention is credited to Robert BAILEY, Shawn BRENNEMAN, Michael HERF, Aaron HOPKINS.
Application Number | 20140281926 14/161684 |
Document ID | / |
Family ID | 38180207 |
Filed Date | 2014-09-18 |
United States Patent
Application |
20140281926 |
Kind Code |
A1 |
BRENNEMAN; Shawn ; et
al. |
September 18, 2014 |
AUTOMATIC DISPLAY OF RESIZED IMAGES
Abstract
Systems and methods for automatic display of scaled and/or
resized images that fit within pre-defined areas in a web browser
are disclosed. The method may be implemented using an image scaling
JavaScript component embedded within a HTML document. Upon resizing
the a client document browser in which the document is displayed,
the component is resized and requests, receives and redisplays a
resized image within the resized component from a server. By having
the server perform the resizing, the resized image not only fits
within the resized component but also maintains the quality of the
image without the need for special client-side software.
Inventors: |
BRENNEMAN; Shawn; (Mountain
View, CA) ; HERF; Michael; (Los Angeles, CA) ;
BAILEY; Robert; (San Francisco, CA) ; HOPKINS;
Aaron; (Hawthorne, CA) |
|
Applicant: |
Name |
City |
State |
Country |
Type |
Google Inc. |
Mountain View |
CA |
US |
|
|
Assignee: |
Google Inc.
Mountain View
CA
|
Family ID: |
38180207 |
Appl. No.: |
14/161684 |
Filed: |
January 22, 2014 |
Related U.S. Patent Documents
|
|
|
|
|
|
Application
Number |
Filing Date |
Patent Number |
|
|
11724600 |
Mar 15, 2007 |
8645860 |
|
|
14161684 |
|
|
|
|
60782920 |
Mar 15, 2006 |
|
|
|
Current U.S.
Class: |
715/238 |
Current CPC
Class: |
G06F 16/9577 20190101;
G06F 40/103 20200101 |
Class at
Publication: |
715/238 |
International
Class: |
G06F 17/21 20060101
G06F017/21 |
Claims
1-40. (canceled)
41. A method for automatic resizing of an image in a document for
display across a network, comprising: serving, to a client
computing device, the document, the document containing
instructions for a client document browser for execution on the
client computing device, to display the image within the client
document browser, the document comprising an embedded image scaling
component, the component being embedded in the document and being
sized relative to a size of the client document browser and
configured to determine the size of the image based on the size of
the component and to request from a server an image scaled to fit
within the determined size and to request from the browser a
temporary, resized image temporarily displayed within the
component, and to replace the temporary, resized image with the
scaled image when received; and receiving the request and, in
response, serving to the client computing device the scaled image
in response to the request for the scaled image from the client
document browser.
42. The method of claim 41, further comprising, prior to serving
the image: (i) scaling a stored image to the size or a resolution
specified in the request from the client document browser; or (ii)
retrieving a stored version of the image of the same or similar
size or resolution specified in the request from the client
document browser.
43. The method of claim 41, wherein the component is a JavaScript
component.
44. The method of claim 43, wherein the JavaScript component is
configured to trap JavaScript resize events fired by the client
document browser.
45. The method of claim 41, wherein the request for the scaled
version of the image contains at least one parameter selected from
a group consisting of a length, a width, and a resolution.
46. The method of claim 41, wherein instructions to request the
scaled version of the image upon resizing of the client document
browser are contained in the component.
47. The method of claim 41, wherein the document further contains
instructions for the client document browser to, upon resizing of
the client document browser, resize the image displayed in the
component prior to the resizing of the client document browser and
temporarily display the image resized by the client document
browser within the component.
48. A system for automatic resizing of an image in a document for
display across a network, comprising: storage for storing the
document that can be served to a client computing device, the
document comprising an embedded image scaling component, and an
image referenced by the document, the document containing
instructions for a client document browser for execution on the
client computing device, to display the image within the client
document browser, the component being embedded in the document, and
being sized relative to a size of the client document browser and
configured to determine the size of the image based on the size of
the component and to request from a server an image scaled to fit
within the determined size and to request from the browser a
temporary, resized image temporarily displayed within the
component, and to replace the temporary, resized image with the
scaled image when received; and a server for serving the document
to the client computing device and for receiving the request for
the scaled image and serving to the client computing device the
scaled image in response.
49. The system of claim 48, wherein the server scales a stored
image to the size or resolution specified in the request from the
client document browser or retrieves a stored version of the image
of the same or similar size or resolution specified in the request
from the client document browser.
50. The system of claim 48, wherein the component is a JavaScript
component.
51. The system of claim 50, wherein the JavaScript component is
configured to trap JavaScript resize events fired by the client
document browser.
52. The system of claim 48, wherein the request for the scaled
version of the image contains at least one parameter selected from
a group consisting of a length, a width, and a resolution.
53. The system of claim 48, wherein instructions to request the
scaled version of the image are contained in the component.
54. The system of claim 48, wherein the document further contains
instructions for the client document browser to, upon resizing of
the client document browser, resize the image displayed in the
component prior to the resizing of the client document browser and
temporarily display the image resized by the client document
browser within the component.
55. A computer readable storage medium having computer program
logic recorded thereon for enabling a processor to automatically
resize an image in a document for display across a network,
comprising: a storage module configured to store a document that
can be served to a client computing device, the document comprising
an embedded image scaling component, and an image referenced by the
document, the document containing instructions for a client
document browser for execution on the client computing device, to
display the image within the client document browser, the component
being embedded in the document, and being sized relative to a size
of the client document browser and configured to determine the size
of the image based on the size of the component and to request from
a server an image scaled to fit within the determined size and to
request from the browser a temporary, resized image temporarily
displayed within the component, and to replace the temporary,
resized image with the scaled image when received; and a server
module configured to serve the document to the client computing
device and to receive the request for the scaled image and serve to
the client computing device a scaled image in response.
56. The computer readable storage medium of claim 55, wherein the
server module is further configured to scale a stored image to the
size or resolution specified in the request from the client
document browser or retrieve a stored version of the image of the
same or similar size or resolution specified in the request from
the client document browser.
57. The computer readable storage medium of claim 55, wherein the
component is a JavaScript component.
58. The computer readable storage medium of claim 57, wherein the
JavaScript component is configured to trap JavaScript resize events
fired by the client document browser.
59. The computer readable storage medium of claim 55, wherein the
request for the scaled version of the image contains at least one
parameter selected from a group consisting of a length, a width,
and a resolution.
60. The computer readable storage medium of claim 55, wherein
instructions to request the scaled version of the image are
contained in the component.
Description
BACKGROUND OF THE INVENTION
[0001] 1. Field of the Invention
[0002] The present invention relates generally to scaling and/or
resizing of images for display over a network. More specifically,
systems and methods for automatic display of scaled and/or resized
images that fit within pre-defined areas in a web browser are
disclosed.
[0003] 2. Description of Related Art
[0004] Web browsers are frequently used to display images stored on
backend servers and transmitted over the Internet or other network.
By default, web browsers generally display fixed-sized images.
However, display of fixed-sized images is often undesirable. For
example, on high resolution displays, images may appear small and
may not take full advantage of the available space in the web
browser window. As another example, in small web browser windows,
large images may not fit within the viewable space of the browser
window, requiring the end user to scroll in order to view the
entire image.
[0005] Although web browsers generally display fixed-sized images
by default, a request may be made by the webpage to the web browser
to resize an image to a size depending on the size of the browser.
However, the quality of the image resized by the web browser is
often low, resulting in blocky poor quality images. In addition,
because the web browser makes a single image transfer request from
the backend server for each image, the largest possible image is
transmitted to the web browser, regardless of the size of the image
to be displayed within the browser. Where the image display area
within the browser is small, the image is resized and extra data
will be unnecessarily transferred, thereby introducing delay.
[0006] Thus, it would be desirable to provide systems and methods
for automatic scaling and/or resizing of images to fit within a
pre-defined area in a web browser. Ideally, such systems and
methods result in high quality resizing of image and would not
require special client-side software to be installed.
SUMMARY OF THE INVENTION
[0007] Systems and methods for automatic display of scaled and/or
resized images that fit within pre-defined areas in a web browser
are disclosed. It should be appreciated that the present invention
can be implemented in numerous ways, including as a process, an
apparatus, a system, a device, a method, or a computer readable
medium such as a computer readable storage medium or a computer
network wherein program instructions are sent over optical or
electronic communication lines. Several inventive embodiments of
the present invention are described below.
[0008] The method, on a client side, for automatic display of
resized images across a network generally include requesting a
document, e.g., an HTML document, having a reference to an image
from a server, displaying the document in a client document
browser, e.g., a web page browser, displaying the image in the
client document browser, automatically requesting a rescaled or
resized image from the server upon resizing of the client document
browser, receiving and displaying the rescaled or resized image
received from the server in the client document browser.
[0009] On a server side, the method for automatic display of a
resized image in a document across a network generally includes
providing the document containing instructions for a client
document browser to display the image within a component in the
document, to rescale the component upon resizing of the client
document browser, and to request a rescaled version of the image
upon resizing of the client document browser, serving the document
in response to a request for the document from the client document
browser, and serving the image of a size specified by the client
document browser to the client document browser.
[0010] The system for automatic display of a resized image in a
document across a network may be implemented as a computer program
product for use in conjunction with a computer system, the computer
program product comprising a computer readable storage medium on
which are stored instructions executable on a computer
processor.
[0011] These and other features and advantages of the present
invention will be presented in more detail in the following
detailed description and the accompanying figures which illustrate
by way of example principles of the invention.
BRIEF DESCRIPTION OF THE DRAWINGS
[0012] The present invention will be readily understood by the
following detailed description in conjunction with the accompanying
drawings, wherein like reference numerals designate like structural
elements.
[0013] FIG. 1 illustrates an exemplary system architecture and
process for automatically displaying resized or rescaled images
that fit within pre-defined areas in a web browser.
[0014] FIG. 2 illustrates an exemplary browser window displaying a
webpage containing an image.
[0015] FIG. 3 illustrates an exemplary resizing of the browser
window displaying the webpage of FIG. 2, the image being
proportionately resized.
[0016] FIG. 4 is a flowchart of an exemplary client-side process
for automatically displaying a resized image in a webpage upon
resizing of a browser window.
[0017] FIG. 5 is a flowchart of an exemplary server-side process to
enable a client-side browser to automatically display a resized
image in a webpage upon resizing of a browser window.
DESCRIPTION OF SPECIFIC EMBODIMENTS
[0018] Systems and methods for automatic display of scaled and/or
resized images that fit within pre-defined areas in a web browser
are disclosed. The following description is presented to enable any
person skilled in the art to make and use the invention.
Descriptions of specific embodiments and applications are provided
only as examples and various modifications will be readily apparent
to those skilled in the art. The general principles defined herein
may be applied to other embodiments and applications without
departing from the spirit and scope of the invention. Thus, the
present invention is to be accorded the widest scope encompassing
numerous alternatives, modifications and equivalents consistent
with the principles and features disclosed herein. For purpose of
clarity, details relating to technical material that is known in
the technical fields related to the invention have not been
described in detail so as not to unnecessarily obscure the present
invention.
[0019] The systems and methods described herein may be used in
various applications for efficient rendering of a web page in a web
browser. The systems and methods described herein generally works
with standard web browsers such as Internet Explorer, Netscape
Navigator, and Mozilla Firefox, without requiring special software
be installed on the client side. In particular, the rescaling
and/or resizing of images as described herein generally does not
require special software to be installed on the client side and
generally utilizes JavaScript. Although JavaScript is presented
herein as illustrative methods for resizing images in browser
windows, any other suitable methods may be similarly employed.
[0020] FIG. 1 illustrates an exemplary system architecture and
process 10 for automatically displaying rescaled images in a web
browser. The system enables a browser to deliver resized images to
an end user, based on the user's viewing environment. As shown, a
browser window 14 is open on a client device 12, such as a personal
computer. The browser 14 may be, for example, a web browser, that
communications with a server 18 via a network 16 such as the
Internet. The server 18 typically stores a webpage 20, typically in
HTML, one or more original image(s) 22 referenced by the webpage
20, an image scaling JavaScript component 24, and an image scaler
28 that can scale the original images 22 to specified sizes.
Although represented as a single block, the server 18 may store
data on one or across multiple servers, e.g., computers. For
purposes of clarity, the server 18 is described herein as generally
serving one webpage that contains one image although the server 18
may serve numerous webpages each containing one or multiple
images.
[0021] The functions of the systems and methods for automatic
scaling and/or resizing of images for display in a web browser will
now be described in more detail with reference to FIGS. 2 and 3. In
particular, FIG. 2 illustrates an exemplary browser window 30
displaying a webpage 32 containing an image 34. As shown in the
illustrative webpage 32, the image 34 generally occupies the width
of the browser window 30. Upon resizing of the browser window 30,
the systems and methods described herein automatically displays a
resized or rescaled image within the browser window. For example,
as shown in FIG. 3, the resized browser window 36 displaying the
webpage 32 is wider than that shown in FIG. 2. The image 38
displayed is proportionately resized within the resized browser
window 36. In the example shown, the image 38 is resized to
similarly occupy the width of the resized browser window 36.
Although the above-described example illustrates an automatic
resizing or rescaling that enlarges the image, the automatic
resizing or rescaling of the image can be similarly applied to
decrease the size of the image.
[0022] When the webpage initially loads in the browser window
and/or when the browser window is resized, the image may be
displayed using a JavaScript component. Generally, the JavaScript
component can be embedded in a typical webpage and sized according
to a fixed or relative size. A fixed size may be specified in terms
of a fixed number of pixels. A relative size may be specified
relative to the size of the browser window, e.g., image width equal
to 1/2 the width of the browser window.
[0023] Once the JavaScript component determines the size of the
image to be displayed, the JavaScript component makes a request to
the backend server for an image scaled to fit within the available
area of the component. When the server receives the request, the
server may scale the image as requested using any suitable image
scaling method. When the server responds with the appropriately
scaled image, the browser window displays the scaled image in the
JavaScript image component. Because the JavaScript component
specifies the exact size to the backend server, the scaled image
should fit within the available area of the JavaScript
component.
[0024] The processes for the client-side and the server-side are
described in more detail below with reference to FIGS. 4 and 5,
respectively. In particular, FIG. 4 is a flowchart of an exemplary
client-side process 50 for automatically displaying a resized image
in a webpage upon resizing of a browser window. Specifically, a
JavaScript component may be used to display images within a
webpage.
[0025] At block 52, a user may request a web page using a browser
via, e.g., the Internet or an intranet, where the web page contains
at least one request for an image. At block 54, the browser
receives and loads the web page, e.g., the HTML source code, from
the server. In addition, the browser may also create the JavaScript
component within the webpage at block 54.
[0026] To initially display the image and each time the image is
resized due to, for example, browser window resizing at block 56,
blocks 58, 60, 62, and 64 may be performed. At block 58, the
JavaScript inside the component determines the size of the
component and thus the size of the image to be requested from the
backend server. In particular, the JavaScript awaits for and traps
JavaScript resize events fired or sent by the browser. it is noted
that when the component is initially created within the webpage,
e.g., when the webpage initially loads in the browser window at
block 54, the size of the component may generally be known.
However, depending on the layout of the page, the size of the image
component may not be known prior to the image component being
created within the webpage.
[0027] The size of the image may be detecting based on a DIV (or
browser window size or similar element in the browser). To request
an image, the size may be transmitted to the server asynchronously.
On handheld devices (where the browser typically occupies the
entire screen), the request may instead include the display
resolution. Alternatively or additionally, the display resolution
may be determined from the browser identification string. In one
example, the browser transmits a width and height to the server and
the server, in response, serves the appropriately sized image.
[0028] At block 60, the JavaScript within the component transmits a
request to the backend server for an image of the size that fits
within the component, e.g., as determined in block 58. For example,
if the component is 668 by 306 pixels, the JavaScript transmits a
request to the backend server for an image that fits within the
area of the component. In other words, when the browser window is
resized, the JavaScript may transmit a request for a newly resized
image from the backend server based on the new size of the
component.
[0029] At block 62, after the image has been initially loaded and
displayed, the webpage may optionally request the browser to resize
and redisplay the image within the component upon browser resizing.
In particular, while the component waits for the request for the
newly resized image to be fulfilled by the backend server, the
browser may temporarily display a rescaled image by rescaling the
existing (already received on the end user/client side) image to
fit within the new component size to give the end user a more
immediate response. However, because this resizing is performed by
the web browser, the quality of the rescaled image is typically
lower than that provided by the server. Once the rescaled image
from the server is received by the component, the image from the
server replaces the temporary image at block 64. It is noted that
although block 62 is shown to be performed after block 60 in the
illustrative flowchart of FIG. 4, block 62 may be performed prior
to block 60 is performed.
[0030] At block 64, when the browser receives the requested image
from the backend server, the browser replaces the temporary image
displayed at block 62 with the rescaled image received from the
server. Because the resized image is scaled to fit within the area
of the component, it would generally occupy the entire area. It is
noted that if the backend server fails to respond to the request
made by the JavaScript at block 62, the webpage may continue to
display the temporary image rescaled by the browser at block 62.
Each time the browser window is resized at block 66, the process 50
returns to perform blocks 58, 60, 62, and 64.
[0031] FIG. 5 is a flowchart of an exemplary server-side process 80
to enable a client-side browser to automatically display a resized
image in a webpage upon resizing a browser window. At block 82, the
server provides a webpage, typically in HTML, that contains at
least one image. At block 84, the server serves the webpage in
response to a browser request for the webpage. For each request for
the image, e.g., initially or upon resizing of the browser, at
block 86, blocks 88 and 90 are performed. At block 88, the server
receives a request for the image of a specified size from client
browser. At block 90, the server scales the image contained in the
webpage according to the size requested by the client browser. The
server may compute the scaled image on the fly or may retrieve the
image from a set of precomputed sizes. At block 92, the server
responds to the request by transmitting the scaled image to the
client browser. Each time the server receives an image request, if
any, at block 94, the process 80 returns to perform blocks 88, 90,
and and 92.
[0032] Typically, the server will have stored thereon an image of a
larger size than those requested by various client browsers such
that the server will resize or rescale an existing larger version
of the requested image to a smaller version of the requested image
to fulfill such requests. However, it is to be understood that the
server may also resize an existing smaller image to a larger
version in response to client browser requests. Further, the server
may also store multiple versions of the same image in various sizes
for more efficient and thus faster scaling and lower computational
costs.
[0033] In requesting the scale image from the server, a smaller
object namespace may be employed to improve the ability to cache
images both on the server and on the client. For example, in one
illustrative implementation, a request called
"GetImage?width=640&height=480" may retrieve the same image as
"GetImage?width=640&height=490". However, a simple caching
server may not notice this and an intermediate proxy or a browser
cache also may not notice this. Thus in another illustrative
implementation, the request may reduce the number of parameters
transmitted to the server and thus transmit only one parameter to
the server. As an example, the request to the server may specify
the maximum size, e.g., the longest edge, for the requested
image.
[0034] The JavaScript transmitted by the server may be configured
to perform simple computations on the client. The server may also
transmit the width and height of the original, e.g., largest
available, image to the client. Alternatively, the aspect ratio of
the image may be provided as a floating point number by the server
although such an implementation may not be as general as
transmitting the original size of the image.
[0035] The JavaScript performs a proportional resize based on the
width and height of the original image. As a result, the client may
make a request to the server with only one parameter. As noted
above, a request with in single parameter may help improve caching.
In addition, upsampling may be allowed or not. Specifically, the
image may be clamped to its original dimensions or stretched to
fill the size in the browser, at the client's option. Proxies may
be shown by using a smaller version of the same image to preview a
larger image. This feature is enabled by determining the resulting
image size prior to requesting the image and allowing the server to
have knowledge of which image corresponds to which resolutions on
the client. Further, zoom may be implemented to allow a cropped
view of a large image, e.g., using a proxy while the image is
loading and pan around within a viewport.
[0036] In some cases, it may be desirable to limit the quantity of
unique images that a client can request from the server. One method
to impose such a limit may be to include certain predetermined
rules with the JavaScript code such that no roundtrip is required
for a client to make valid requests to a server. Examples of such
rules include a list of valid sizes and/or math to compute valid
sizes. For example, one rule may specify that the client may only
request images whose longest edge is of a length (in pixels) that
is a multiple of 16. As another example, a list of precomputed
sizes might be additionally or alternatively provided.
[0037] While the exemplary embodiments of the present invention are
described and illustrated herein, it will be appreciated that they
are merely illustrative and that modifications can be made to these
embodiments without departing from the spirit and scope of the
invention. For example, the systems and methods described herein
are preferably implemented without requiring special software be
installed on the client side, as generally described in the
illustrative examples presented. As one alternative, the systems
and methods may be implemented as a web browser plug-in, for
example. However, such alternative methodologies require the user
to install special client software. Thus, the scope of the
invention is intended to be defined only in terms of the following
claims as may be amended, with each claim being expressly
incorporated into this Description of Specific Embodiments as an
embodiment of the invention.
* * * * *