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

Path Picasso save image #1317

Closed
alexxsera opened this issue Mar 15, 2016 · 7 comments
Closed

Path Picasso save image #1317

alexxsera opened this issue Mar 15, 2016 · 7 comments

Comments

@alexxsera
Copy link

Hello

I have the need to move in an intent of the photo uri
You can be derived in some way this information in Picasso?

thank you

@JakeWharton
Copy link
Member

I don't understand the question. You want to read a photo URI from an intent or send an intent with a photo URI?

@alexxsera
Copy link
Author

Yes, sorry for my bad English!!! I would like to start an intent passing a picasso's photo URI in it... this intent is to an external application (instagram).

Thanks,
Alessandro

@bo-bda
Copy link

bo-bda commented Mar 15, 2016

I think you want to get a cached image which you wants to open in new activity, isn't it? If it's true you need any cache photo client.

@alexxsera
Copy link
Author

Ok, I will make it simpler.... it is possible to get a cached photo local URI? :)

Thanks,
Alessandro

@alexxsera
Copy link
Author

example instagram intent

String type = "image/*";
String filename = "/myPhoto.jpg";
String mediaPath = Environment.getExternalStorageDirectory() + filename;

createInstagramIntent(type, mediaPath);

private void createInstagramIntent(String type, String mediaPath){

// Create the new Intent using the 'Send' action.
Intent share = new Intent(Intent.ACTION_SEND);

// Set the MIME type
share.setType(type);

// Create the URI from the media
File media = new File(mediaPath);
Uri uri = Uri.fromFile(media);

// Add the URI to the Intent.
share.putExtra(Intent.EXTRA_STREAM, uri);

// Broadcast the Intent.
startActivity(Intent.createChooser(share, "Share to"));

}

@bo-bda
Copy link

bo-bda commented Mar 17, 2016

save file to disk and then share it any way wherever you want.

@JakeWharton
Copy link
Member

Unfortunately we don't have any easy way to save an image to disk. You'll have to load and save the Bitmap yourself by passing a Target instance to into() which then compresses it to a file. There's a feature request (#506) for being able to save an image to a file, but there's some limitations in the internal pipeline which prevent it from being added easily.

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

No branches or pull requests

3 participants