picasso

Resize image to full width and fixed height with Picasso

混江龙づ霸主 提交于 2019-12-17 05:37:52
问题 I have a vertical LinearLayout where one of the items is an ImageView loaded using Picasso. I need to rise the image's width to the full device width, and to display the center part of the image cropped by a fixed height (150dp). I currently have the following code: Picasso.with(getActivity()) .load(imageUrl) .placeholder(R.drawable.placeholder) .error(R.drawable.error) .resize(screenWidth, imageHeight) .centerInside() .into(imageView); Which values should I put into screenWidth and

Local image caching solution for Android: Square Picasso, Universal Image Loader, Glide, Fresco?

爷,独闯天下 提交于 2019-12-17 02:33:29
问题 I am looking for an asynchronous image loading and caching library in Android. I was going to use Picasso, but I found Universal Image Loader is more popular on GitHub. Does anyone know about these two libraries? A summary of pros and cons would be great. (All my images are on disk locally, so I don't need networking, therefore I don't think Volley is a fit) 回答1: Update Sep 2018: After several years, I needed the almost same thing for a local image caching solution. This time around, UIL has

Blur thumbnail image before loading actual image in picasso

只愿长相守 提交于 2019-12-14 03:57:17
问题 i am using picasso to display the image from URL, i am displaying thumbnail image first before loading actual image, i want to blur that thumbnail image , how i can achieve in picasso ? here is my source code pb.setVisibility(View.GONE); Picasso.with(getApplicationContext()) .load(thumbUrl) // thumbnail url goes here //.placeholder(R.drawable.progress_animation) .resize(width, width) .transform(new BlurTransformation(getApplicationContext(), 25, 1)) .into(imageview, new Callback() { @Override

Picasso with ArrayAdapter

萝らか妹 提交于 2019-12-14 01:53:50
问题 I just want to start off with loading 1 picture using Picasso using ArrayAdapter. I think i'm missing something minor (hopefully). Just wondering if someone can point me to right direction. I'm getting a NullPointer Exception. This is the MainActivity source code: public class MainActivity extends AppCompatActivity { ListView listView; ArrayList<DataModel> dataModel; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout

Caching in Picasso

雨燕双飞 提交于 2019-12-13 21:07:58
问题 After reading several documentations, i want to clear some points Reference: this For Picasso to cache my image into memory, do i have to enable "Cache-control" header in my response? If i am using OkHttpDownloader with Picasso,will it still require me to enable the header? public Picasso getImageLoader(Context ctx) { Picasso.Builder builder = new Picasso.Builder(ctx); builder.downloader(new OkHttpDownloader(ctx) { @Override protected HttpURLConnection openConnection(Uri uri) throws

How do use use Picasso library while downloading images from Amazon S3?

无人久伴 提交于 2019-12-13 14:15:23
问题 I am storing my images on Amazon S3. I use the following code to download image from Amazon S3 S3ObjectInputStream content = s3Client.getObject("bucketname", url).getObjectContent(); byte[] bytes ; bytes = IOUtils.toByteArray(content); bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.length); bitmap = Bitmap.createScaledBitmap(bitmap, width, height, true); bitmap = CommonUtilities.getRoundedCornerBitmap(bitmap, 30); cache.put(url, new SoftReference<Bitmap>(bitmap)); return bitmap; While

Wired Image loading issue in Picasso

与世无争的帅哥 提交于 2019-12-13 09:28:48
问题 I am using Picasso whose dependency is added in the gradle file compile 'com.squareup.picasso:picasso:2.5.2' This is My class public class ImageLoader { private Picasso mPicasso; private static ImageLoader mInstance; public static ImageLoader getInstance(Context context) { if(mInstance==null) mInstance = new ImageLoader(context); return mInstance; } private ImageLoader(Context context) { mPicasso = new Picasso.Builder(context).build(); } private Picasso getImageLoader(Context context) {

Android - MultiDexEnable=true causes Picasso to Crash

好久不见. 提交于 2019-12-13 08:19:24
问题 I've used MultiDexEnable=true command in my gradle file to integrate the cometChat sdk . But Picasso library which was running fine is crashing now giving the following error. Can you please guide towards solution? apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion "23.0.2" useLibrary 'org.apache.http.legacy' defaultConfig { applicationId "com.edesign.astutesol.eyesapp" minSdkVersion 15 targetSdkVersion 23 versionCode 1 versionName "1.0" multiDexEnabled

Setting key for picasso for S3 Amazon

流过昼夜 提交于 2019-12-13 07:14:28
问题 I am trying to use amazon S3 Client for my files uploading and downloading. For caching i am trying to use Picasso right now. There are few points to note. 1- In S3, there is no single link for a file. I have to randomly generate a url for each image. This url will expire most likely in 1 min or i can set it to expire in 1 hour. In my onCreateView of my adapter i am calling something like this String url = getAmazonTempUrl() 2- Each file name will be same but they can be modified on server. e

Picasso Target must not be null error

こ雲淡風輕ζ 提交于 2019-12-13 04:38:40
问题 I wish to add an image from Parse.com to an ImageView in a fragment I have created using Picasso. I get a Target must not be null. error in logcat whenever I try to open the fragment. This is occurring in .into(mProfilePicture); in the updateProfilePic() . Can anyone tell me why this is happening? public class MyProfileFragment extends Fragment implements View.OnClickListener { public static final String TAG = MyProfileFragment.class.getSimpleName(); protected Button mTakePicture; protected