Skip to content

Automatically resize images which are too large to fit in GL textures. #754

@tienloantran

Description

@tienloantran

Figure out how to query the max GL texture size and automatically resize images which are going into the UI to be less than that.

(edited by @JakeWharton)


original description:

Showing placeholder or error is a resource in white and therefore when set should change the colorfilter of it when callback returns error and ofcourse the filter is removed when successful. I kept getting error eventhough I know that the image used exist because I tried to replace it in placeholder and error and both times worked. I found out the issue with it was that resize(...) and the image (ImageView) have the same size and therefor doesn't resize the image, when I removed resize(...) it stopped giving me error callbacks and became successful.

        Picasso.with(mContext)
                .load(imagePath)
                .placeholder(R.drawable.ic_person)
                .error(R.drawable.ic_delete)
                //.resize(R.dimen.size_xhuge, R.dimen.size_xhuge)
                .into(image, new Callback() {
                    @Override
                    public void onSuccess() {
                        Log.d("STAT", "SUCCESS");
                        image.clearColorFilter();
                    }

                    @Override
                    public void onError() {
                        Log.d("STAT", "ERROR");
                        image.setColorFilter(context.getResources().getColor(R.color.text), PorterDuff.Mode.SRC_ATOP);
                    }
                });

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions