bumptech / bumptech/glide

Fail to load valid PNG file with encodeFormat and encodeQuality

Open
#3,388 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
35k
Forks
6.2k
Avg merge
1d 11h
Merged PRs (30d)
8

Description

**Glide Version**: 4.8.0
**Integration libraries**: nothing
**Device/Android Version**: issue on any device

**Issue details / Repro steps / Use case background**:
i'm trying to load an uncompressed PNG to bytes array. i was able to get a valid PNG with the Glide version 3 but the Glide version 4 give me a non valid PNG format

**Glide load line / `GlideModule` (if any) / list Adapter code (if any)**:
```
RequestOptions options = new RequestOptions()
.encodeFormat(CompressFormat.PNG)
.encodeQuality(0)
.override(800, 800)
.fitCenter();

Glide.with(this)
.as(byte[].class)
.apply(options)
.load(uriSelected)
.into(target);
```

it used to load valid PNG data with Glide 3 like this:
```
Glide.with(this)
.load(uriSelected)
.asBitmap()
.toBytes(CompressFormat.PNG, 0)
.override(800, 800)
.fitCenter()
.into(target);

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.