History log of /frameworks/opt/photoviewer/src/com/android/ex/photo/util/ImageUtils.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
bb137c8e2ed363e6f5e2c0f14719483d27e8c062 05-Jun-2014 Mathew Inwood <mathewi@google.com> Move all logic from activity into controller.

Get rid of ControllerCallbacks, and instead create a thin wrapper around
Activity exposing the functionality required from the activity. Do the same
for ActionBar to take care of android.support.v7.app.ActionBar and
android.app.ActionBar (which have an identical interface).

This eliminates a lot of duplicate code between the appcompat activity and
the other activity. The only duplicated code is not boring wrapper code.

To customize the activity now, subclass PhotoViewController and implement
customizations in there. Then subclass the Activity and override
createController to instantiate your controller subclass.

Also allow subclassing of PhotoViewFragment. This is to enable the fragment
to replace the logic of getting the controller from the activity, in the
instance that the activity does not implement ActivityInterface directly
itself.

Bug: 15090270
Change-Id: Ib31ae155b5afabff848624b0721d6eaf96312c12
/frameworks/opt/photoviewer/src/com/android/ex/photo/util/ImageUtils.java
274afea9b667b551d9582a3088fc27012d0e9a29 21-Mar-2014 Hao Pan <haopan@google.com> Add a null check before closing the stream

Bug 13558751

Change-Id: Ib1d5d1b9df3ce961ce1012b69abea56ebaecf695
/frameworks/opt/photoviewer/src/com/android/ex/photo/util/ImageUtils.java
7a75fba57ed82c4b0fea362ce739ab253eac909f 22-Oct-2013 Adam Copp <adamcopp@google.com> Remove HTTP downloads from photoviewer lib.

These downloads should only have been used by android GSA and were a
temporary hack.

Android GSA will now use it's own Loader to do HTTP downloads.

Bug: 10688301
Change-Id: I62ab62c8f2f0aa2b969bf491c33d10d3db828e9b
/frameworks/opt/photoviewer/src/com/android/ex/photo/util/ImageUtils.java
f75b928f1eacf6455732fa9e0e0fd7762f20e081 20-Aug-2013 Scott Kennedy <skennedy@google.com> resolved conflicts for merge of c631b5a4 to klp-dev

Change-Id: I4f5537100f047ca2f58e66a5f0334cbc774cab5c
c631b5a4b1f19f84a70b772bc879fae7c92fd4a8 13-Aug-2013 Mark Wei <markwei@google.com> Decode EXIF data from input streams.

Create new wrapper class that allows us to treat an input stream as a byte[].
We buffer the minimum number of bytes necessary to avoid unnecessary allocations
which lead to GCs.

For a 1MB image, we get:
Much less memory: 16 bytes instead of 1,048,576 bytes.
Faster, less bytes read: 76 bytes for part of the header instead of 1,048,576
bytes.
Much less GCs: 0 GCs, compared to multiple 30ms GC for allocs in my testing.

Bug: 10036191
Change-Id: Ie8b4546f157a6870b6735a36a38889fe34862c83
/frameworks/opt/photoviewer/src/com/android/ex/photo/util/ImageUtils.java
ca8fdcd23fcc53e0429abf8d4ef80e8d6d8fe6fa 30-Jun-2013 Martin Hibdon <mhibdon@google.com> Update PhotoViewer so that Babel can use it

The photoViewer now supports the needs of the Babel app.
In particular:
1. It allows for applications to extend the PhotoBitmapLoader
for their own needs. Babel needs this because it already
maintains a customized image cache in memory, and we don't
want to have duplicate bitmaps in memory.
2. The photoViewActivity can optionally use an animation
that scales the image up from the image's original location
on screen to the full size.
3. The photoViewActivity can optionally be in fullscreen
mode by default, rather than switching to fullscreen
when tapped.

Change-Id: Id5d62f1961c1ce2b9402c7fb19583baad4d96580
/frameworks/opt/photoviewer/src/com/android/ex/photo/util/ImageUtils.java
73841d3240ea553c5f95400a4bbf83dbbb3f872f 31-Jul-2013 Scott Kennedy <skennedy@google.com> Remove all remaining warnings

Or at least, those that my Eclipse settings can pick up

Change-Id: I416b89bdf0068734cbacd2a220ae108c12301e85
/frameworks/opt/photoviewer/src/com/android/ex/photo/util/ImageUtils.java
112958e7a0493f2e692bbc40d113e98715caaab8 25-Mar-2013 Adam Copp <adamcopp@google.com> Hide spinners if airplane mode enabled whilst browsing images

This change ensures loading spinners are hidden if the image cannot be
loaded, such as when we enter airplane mode.

The behaviour is poor upon returning from airplane mode - spinners do
not show immediately, and loads may not kick off until the user scrolls
around.

Bug: 8407579

Change-Id: If11b4f9a453eeb2f381a77a860fb32c87dbd3b13
/frameworks/opt/photoviewer/src/com/android/ex/photo/util/ImageUtils.java
06d8b5e82b9b75588051a492152fda0b63f70484 08-Mar-2013 Mark Wei <markwei@google.com> When image bytes are unable to be decoded into a Bitmap (like TIFF files), we
distinguish that apart from when there are no image bytes at all.

In the first case, the download was complete and the file is present, but the
decoding fails. In the second case, the download is still in progress. We now
show an error in the first case.

Bug: 8229258
Change-Id: I664a322f1656dc10d632dcdb259d817abc894047
/frameworks/opt/photoviewer/src/com/android/ex/photo/util/ImageUtils.java
2de1aa6bc9a936ff3f2f654db770a091904533d7 13-Feb-2013 Mark Wei <markwei@google.com> Ignore the SecurityException for now so that Gmail does not crash. A later CL
will fix the underlying issue.

Bug: 8184899
Change-Id: Iae9e452367237442d723794b95313e3afbb36a48
/frameworks/opt/photoviewer/src/com/android/ex/photo/util/ImageUtils.java
dccd6d91ca82225395af470595e4ffb8734dac1a 26-Nov-2012 Mark Brophy <mbrophy@google.com> Support data URIs in photoviewer.

GoogleSearch needs to support data URLs, since GWS often provides
thumbnails in that way.

Change-Id: Ic981725ef052eb61f780aa3672b3cfbde721696b
/frameworks/opt/photoviewer/src/com/android/ex/photo/util/ImageUtils.java
3102e82e0187363d453f4bcde00e396ef5420a46 24-Oct-2012 Adam Copp <adamcopp@google.com> Remove unused imports and variables

Removes a couple of unused imports and an unused variable

Change-Id: Ie2b0109230a3393adde69a0744af5d0f262b5b8e
/frameworks/opt/photoviewer/src/com/android/ex/photo/util/ImageUtils.java
7aabd796bbcb149db9ac183c1d0aec09fccd42a4 05-Oct-2012 Adam Copp <adamcopp@google.com> Temporary fix for image viewer crash

This fixes a bug causing the app to crash when we can't open a stream to
a url when we download an image.

Bug: 7294701
Change-Id: Ifd0c62c3f5bb6a168e2e2932734fa448ffb9344c
/frameworks/opt/photoviewer/src/com/android/ex/photo/util/ImageUtils.java
237ded1a59b1fc148a3ffcf78d6f9d34af5c170c 26-Sep-2012 Paul Westbrook <pwestbro@google.com> resolved conflicts for merge of b3f0f056 to master

Change-Id: I5def1804466ff971ed5bc5afd2a2d68e135d20a2
9323b13fc9bc79ce38ce7c851a2aa894ab988ed0 20-Sep-2012 Paul Westbrook <pwestbro@google.com> Add Exif parser

Class to parse exif headers of images to detect orientation

Modify ImageUtils#decodeStream to parse the exif header and respect
orientation

Bug: 7087307

Change-Id: I93c3a69a50ae26d3fd4e96944439f87e9d511945
/frameworks/opt/photoviewer/src/com/android/ex/photo/util/ImageUtils.java
ae78bbd1c97e702147b29966903ca6e08ed3616f 13-Sep-2012 Adam Copp <adamcopp@google.com> Add option to permenantly show ProgressBar

In order to indicate to the user that more content is loading, the
provider can provide an image with the loading field set and null as it's
url. In this case, we will not try loading any image, and will just show the
ProgressBar.

Something like this is nessecary in Velvet, where we wish to load
infinite images.

Change-Id: Ib26412a579abdbe7fbd338b99ff39f4d1c13f806
/frameworks/opt/photoviewer/src/com/android/ex/photo/util/ImageUtils.java
f24e7099f9688518d705116c1b4279fc6279d3d6 30-Aug-2012 Mark Wei <markwei@google.com> resolved conflicts for merge of f688fc95 to master

Change-Id: Ib4ade547d76faa4a730b75ea691c1cf1f99888cd
0f7d1502f4f7c0b364e7644875a04fb0c90807ff 30-Aug-2012 Mark Wei <markwei@google.com> Fix NullPointerException when tapping attachment.

Bug: 7083179
Change-Id: I9955aeda9a0d2bb6d30ce9f7e7e3961cb47284e0
/frameworks/opt/photoviewer/src/com/android/ex/photo/util/ImageUtils.java
bd8b47b147f29f196f37d66ccb561d40414ab5b6 22-Aug-2012 Adam Copp <adamcopp@google.com> Add HTTP uri handling & fetch thumbnail first

If a http:// or https:// url is specified as the thumbnail uri or
regular uri for an image, we attempt to fetch it over the internet.

Also, changed the order of loading so that we always attempt to fetch
the thumbnail image before we fetch the regular image. This aids in the
http:// uri case, since it should take significantly less time to be
presented with a thumbnail than the full image.

Finally, finishes the photo viewer activity when the "top" button on the
action bar is pressed, unless a custom override has been added.

These 3 changes could be seperated into different patches if you would
like

Change-Id: Iddc8cc6bef3f9e66198dfb98eb2f7bd309023b3f
/frameworks/opt/photoviewer/src/com/android/ex/photo/util/ImageUtils.java
1f00d9d7c4beb007d491fc766f7a0c8fc4977a50 31-Jul-2012 The Android Open Source Project <initial-contribution@android.com> Recover changes from jb-mr1-dev

Change-Id: I64acaaedf5f6fd689c0bddcbf26d9eaa66a8f287
/frameworks/opt/photoviewer/src/com/android/ex/photo/util/ImageUtils.java
9418aa1ad5f48066e41b3b5405c6c03caf3653d9 30-Jul-2012 The Android Automerger <android-build@android.com> merge in jb-mr1-release history after reset to jb-mr1-dev
/frameworks/opt/photoviewer/src/com/android/ex/photo/util/ImageUtils.java
9db663e1e820c3445f57fe11d9a12e9c8777e704 27-Jul-2012 Andrew Sapperstein <asapperstein@google.com> Partial fix of 6890014.

No longer crashing. But the attachment is now
in a very weird state.

Change-Id: If688d9c19a81124cbd1ecd0266821800f76f3c74
/frameworks/opt/photoviewer/src/com/android/ex/photo/util/ImageUtils.java
8122882aaf14820bc2241605b2ab818ad358b9af 27-Jun-2012 Ying Wang <wangying@google.com> Import translations. DO NOT MERGE

Change-Id: Ib683da0aa64c2c63dfc672ea18b7417aded3ec5c
/frameworks/opt/photoviewer/src/com/android/ex/photo/util/ImageUtils.java