1

I used picasso and get HTTP 504 error this is how I used picasso

 Photo photo = photos.get(position);
    holder.userName.setText(photo.getId());
    String imageUri = photo.getPhotoURL().getThumb();

Picasso.get().setLoggingEnabled(true);
    Picasso.get()
            .load(imageUri)
            .resize(200,200)
            .into(holder.photo, new Callback() {
                @Override
                public void onSuccess() {
                    Log.d("error-log", "onSuccess");
                }

                @Override
                public void onError(Exception e) {
                    Log.d("error-log", e.getMessage());
                }
            });

this is my logcat

2021-11-30 16:19:02.436 5896-5896/com.example.wallpaperapp D/Picasso: Main        created  

    [R0] Request{https://images.unsplash.com/photo-1633113089631-6456cccaadad?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=MnwyNzc5MDJ8MXwxfGFsbHwxfHx8fHx8Mnx8MTYzODI3NjU0Mg&ixlib=rb-1.2.1&q=80&w=200 resize(200,200)}
2021-11-30 16:19:02.440 5896-5930/com.example.wallpaperapp D/Picasso: Dispatcher  enqueued     [R0]+4ms 
2021-11-30 16:19:02.441 5896-5932/com.example.wallpaperapp D/Picasso: Hunter      executing    [R0]+5ms 
2021-11-30 16:19:02.442 5896-5896/com.example.wallpaperapp D/Picasso: Main        created      [R1] Request{https://images.unsplash.com/photo-1638274457917-d86ec719bed8?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=MnwyNzc5MDJ8MHwxfGFsbHwyfHx8fHx8Mnx8MTYzODI3NjU0Mg&ixlib=rb-1.2.1&q=80&w=200 resize(200,200)}
2021-11-30 16:19:02.443 5896-5930/com.example.wallpaperapp D/Picasso: Dispatcher  enqueued     [R1]+0ms 
2021-11-30 16:19:02.446 5896-5933/com.example.wallpaperapp D/Picasso: Hunter      executing    [R1]+3ms 

I add Internet permission I also used Glide but I got the same result I check the solutions but could not solve the issue I used thumb because I searched and understand Its because of big image maybe , but again not loading image I checked out this and does not help

Mhb flh
  • 31
  • 8
  • Does this answer your question? [Error HTTP 504 When load image form URL with picasso android library](https://stackoverflow.com/questions/58430498/error-http-504-when-load-image-form-url-with-picasso-android-library) – Nitish Nov 30 '21 at 13:08
  • no I test that but still getting same result – Mhb flh Nov 30 '21 at 13:31

1 Answers1

0

I got a image link from your source code and check size of image, it is +14MB. It might be reason of this issue. Try to set another sample image link which has some KBs. Kindly check it

Syed Bilal
  • 81
  • 5