Repository navigation
Conversation
Amp-Thread-ID: https://ampcode.com/threads/T-36c35a02-40bd-4f23-a6db-7f5f10bc693e Co-authored-by: Duncan McClean <duncan@duncanmcclean.com>
Amp-Thread-ID: https://ampcode.com/threads/T-36c35a02-40bd-4f23-a6db-7f5f10bc693e Co-authored-by: Duncan McClean <duncan@duncanmcclean.com>
edalzell
marked this pull request as ready for review
November 20, 2026 00:14
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #15970 (Group B).
Imaging\Attributes::from()copied the whole image off a remote disk to read its dimensions. Now it reads the first 64 KB, doubling up to 2 MB until the dimensions and EXIF orientation are readable, and falls back to the full copy if that isn't enough. S3 uses ranged requests viaS3MetadataStream(256 KB chunks), since Laravel's S3readStream()downloads the whole object by default. Local disks and SVGs are unchanged.Depends on #15934 for
S3MetadataStream, so its commits show in the diff until it lands. Onlysrc/Imaging/Attributes.php, the$chunkSizeargument onS3MetadataStream,tests/Fakes,tests/Imaging/RemoteAttributesTest.phpandtests/Search/InsertMultipleJobAssetsTest.phpbelong to this PR.For #14061,
InsertMultipleJobAssetsTestasserts thatInsertMultipleJobon a remote disk reads image headers rather than whole files, reads nothing when sidecars exist, resumes where it left off when retried, reads nothing when run again, and still only reads headers when saving an asset rebuilds a missing index.Not tested against a real S3 bucket.
Benchmark
20 images of 2 MB each plus a PDF, on a counting fake remote disk. The fake exercises the generic stream path, not the S3 ranged path.
Bytes read from the disk:
generateMeta, 20 imagesInsertMultipleJob, cold cache, no sidecarsInsertMultipleJobretried after dying halfwayAll disk operations with this PR:
generateMeta, 20 imagesInsertMultipleJob, cold cache, no sidecarsInsertMultipleJobagain, warm cacheInsertMultipleJob, cold cache, sidecars presentInsertMultipleJobretried after dying halfway