Skip to content

Commit a68f1e3

Browse files
committed
Invalidate image after all transforms in demo app
1 parent 1c4b977 commit a68f1e3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/src/main/java/com/jpegkit/app/JpegActivity.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ public boolean onOptionsItemSelected(MenuItem item) {
154154

155155
private void invalidateJpeg() {
156156
mJpegBytes = mJpeg.getJpegBytes();
157-
158157
mImageView.setJpeg(mJpeg);
159158

160159
TextView dimensionsTextView = findViewById(R.id.dimensionsTextView);
@@ -181,10 +180,12 @@ private void rotate(int degrees) {
181180

182181
private void flipHorizontal() {
183182
mJpeg.flipHorizontal();
183+
invalidateJpeg();
184184
}
185185

186186
private void flipVertical() {
187187
mJpeg.flipVertical();
188+
invalidateJpeg();
188189
}
189190

190191
private void crop() {
@@ -244,6 +245,7 @@ public void onClick(DialogInterface dialog, int which) {
244245
}
245246

246247
mJpeg.crop(new Rect(left, top, right, bottom));
248+
invalidateJpeg();
247249
} catch (Exception e) {
248250
Toast.makeText(JpegActivity.this, "Enter values into all fields.", Toast.LENGTH_SHORT).show();
249251
return;

0 commit comments

Comments
 (0)