Skip to content

Commit

Permalink
Style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnWowUs committed May 20, 2015
1 parent fdbb01b commit 597445c
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions picasso/src/main/java/com/squareup/picasso/ExifStreamReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Adapted for picasso
*
* Adapted for picasso
*/

package com.squareup.picasso;
Expand All @@ -28,17 +28,16 @@ final class ExifStreamReader {
// Returns the orientation value
public static int getOrientation(InputStream stream) throws IOException {
if (stream == null) {
return 0 ;
return 0;
}
MarkableInputStream markStream = new MarkableInputStream(stream);
long mark = markStream.savePosition(65536);
long mark = markStream.savePosition(65536);
byte[] header = new byte[65536];
markStream.read(header);
markStream.reset(mark);

return getOrientation(header);
}

// Returns the orientation value
static int getOrientation(byte[] jpeg) {
if (jpeg == null) {
Expand Down Expand Up @@ -75,9 +74,9 @@ static int getOrientation(byte[] jpeg) {
}

// Break if the marker is EXIF in APP1.
if (marker == 0xE1 && length >= 8 &&
pack(jpeg, offset + 2, 4, false) == 0x45786966 &&
pack(jpeg, offset + 6, 2, false) == 0) {
if (marker == 0xE1 && length >= 8
&& pack(jpeg, offset + 2, 4, false) == 0x45786966
&& pack(jpeg, offset + 6, 2, false) == 0) {
offset += 8;
length -= 8;
break;
Expand Down Expand Up @@ -124,9 +123,9 @@ static int getOrientation(byte[] jpeg) {
case 6:
case 7:
case 8:
return orientation ;
return orientation;
default:
break ;
break;
}
Log.i(TAG, "Unsupported orientation");
return 0;
Expand Down

0 comments on commit 597445c

Please sign in to comment.