Skip to content

Fix: Hide "Edit Image" button for unsupported non-JPEG files#6653

Merged
RitikaPahwa4444 merged 2 commits intocommons-app:mainfrom
Kota-Jagadeesh:disable-edit-unsupported-formats
Feb 22, 2026
Merged

Fix: Hide "Edit Image" button for unsupported non-JPEG files#6653
RitikaPahwa4444 merged 2 commits intocommons-app:mainfrom
Kota-Jagadeesh:disable-edit-unsupported-formats

Conversation

@Kota-Jagadeesh
Copy link
Collaborator

Description (required)

Fixes #6642 (comment)

What changes did you make and why?

  • Added a file extension check in UploadMediaDetailFragment to verify if the uploaded image is a JPEG.
  • Hides the "Edit Image" button (llEditImage.visibility = View.GONE) for non-JPEG formats like GIF, PNG, and WEBP.
  • Why: the underlying image rotation library (LLJTran) only supports lossless JPEG transformations. Attempting to edit and save other file types resulted in errors and blank images. so, hiding the edit option for unsupported files is the cleanest ux solution.

Tests performed (required)

Tested ProDebug on Redmi Note 13 Pro with API level 35.

  • Uploaded a .jpg file -> "Edit Image" button is visible and works.
  • Uploaded a .gif and .png file -> "Edit Image" button is completely hidden.

Screenshots (for UI changes only)

image

Note: Please ensure that you have read CONTRIBUTING.md if this is your first pull request.

@RitikaPahwa4444 RitikaPahwa4444 merged commit f4afc05 into commons-app:main Feb 22, 2026
2 checks passed
@github-actions
Copy link

✅ Generated APK variants!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants