Skip to content

perf(image): remove redundant getimagesize() call in JPEG load path#61599

Open
joshtrichards wants to merge 1 commit into
masterfrom
jtr/imageLoadJPG-drop-redundant
Open

perf(image): remove redundant getimagesize() call in JPEG load path#61599
joshtrichards wants to merge 1 commit into
masterfrom
jtr/imageLoadJPG-drop-redundant

Conversation

@joshtrichards

Copy link
Copy Markdown
Member

Summary

Remove the second getimagesize() call from the JPEG branch in OC\Image::loadFromFile().

After PR #46342 this second call become redundant. checkImageSize() already calls getimagesize() and returns false when the image data cannot be read, so the JPEG-specific follow-up check is redundant. The image can be passed directly to imagecreatefromjpeg() after the existing guard succeeds.

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Signed-off-by: Josh <josh.t.richards@gmail.com>
@joshtrichards joshtrichards added this to the Nextcloud 35 milestone Jun 25, 2026
@joshtrichards joshtrichards requested a review from a team as a code owner June 25, 2026 16:29
@joshtrichards joshtrichards requested review from Altahrim, come-nc, icewind1991 and salmart-dev and removed request for a team June 25, 2026 16:29
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.

1 participant