Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MediaStore thumbnails aren't rotated correctly. #400

Closed
sjudd opened this issue Apr 13, 2015 · 5 comments
Closed

MediaStore thumbnails aren't rotated correctly. #400

sjudd opened this issue Apr 13, 2015 · 5 comments
Labels
Milestone

Comments

@sjudd
Copy link
Collaborator

sjudd commented Apr 13, 2015

Branching out of #395

@eicm
Copy link

eicm commented Apr 28, 2015

I want to extend FilterOutputStream to write out the orientation in my output stream:

FileOutputStream out = new ExifOrientationOutStream(path, orientation);
bitmap.compress(Bitmap.CompressFormat.JPEG, 80, out);
out.flush();

I appreciate it if you can guide me in the correct direction to write a ExifOrientationOutStream

@sjudd
Copy link
Collaborator Author

sjudd commented Apr 28, 2015

@eicm Can you file a new issue? That might be a little out of scope for the project though. When do you want to write out the exif orientation?

@eicm
Copy link

eicm commented Apr 28, 2015

I'm not sure it would be in the scope of the project, do you want me to open it as a new issue?
My personal usage is glide related but doesn't fit in the project as a feature. When I download a bitmap and want to write it to the disk, I already have downloaded the meta data for that media. I want to write in the Exif orientation in an optimized way so when I use glide to load that image with the correct orientation.

EndPointManager.downloadImage(context, Request.Priority.NORMAL, url,  new Listener<Bitmap>() {
    @Override
    public void onResponse(Bitmap bitmap) {
        ...
        FileOutputStream out = new ExifOrientationOutStream(path, orientation); 
        bitmap.compress(Bitmap.CompressFormat.JPEG, 80, out);
        out.flush();
        ...

@TWiStErRob
Copy link
Collaborator

Yes, new questions should be in new issues (you can reference other use ones by number if you want more context in the new one.)

Why don't you just rotate the Bitmap based on orientation before writing? I'm sure you can find simple utility methods for that by Googling.

@eicm
Copy link

eicm commented Apr 28, 2015

I'm rotating it in the onResourceReady() call back based on the orientation. I understand it's out of the scope, don't worry about it I will find it myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants