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.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change default Resource.fetchImage flipY to false #7701
Change default Resource.fetchImage flipY to false #7701
Changes from all commits
9dbb78a
d900910
758cd16
22f1943
b537560
297abaf
4b6895c
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a few places including here that don't pass in
preferBlob: true
. Should they?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Especially curious about
ImageryProvider
not usingpreferBlob
sincepreferBlob
is helpful forImageBitmap
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm actually not sure when in general we want to set
preferBlob: true
. @mramato do you have any insight here?In terms of using ImageBitmap,
preferImageBitmap
forces it to fetch it as a blob, otherwise decoding is locked to the main thread.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
preferBlob
is something you don't want to set unless you are working around limitations inherent in using an Image element.Some of these include:
DiscardMissingTileImagePolicy
does this.It's possible I'm forgetting something, but I think those are the only 2. If
preferImageBitmap
implies preferBlob is true, that's fine and the end result is transparent to the user.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, if you set
preferBlob: true
, it still gives you back anImage
. It just stores theblob
to it as well so you can do things like read the bytes or size etc. right?The
image.blob = blob
is not set when using ImageBitmap, so I'm surprised nothing has broken there. Also, it looks like if an ImageryProvider has a discard policy, it's going to load every tile with its blob?https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Scene/ImageryProvider.js#L347-L349
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this is necessary because when you first create the DiscardMissingTileImagePolicy, it does one request, to check what the missing tile looks like? And then that's why we need
preferBlob: true
on every subsequent request, to check if what we got is a missing tile or a real tile, if I'm reading this right.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, so looks like all we need to do here is make sure when you set
preferBlob: true
you can access the blob, regardless of whether it's loading usingImage
orImageBitmap
. But when you want to usepreferBlob
and when you want to usepreferImageBitmap
are unrelated.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And part of that was my confusion because I didn't notice that
ImageBitmap
was always requesting a blob regardless of thepreferBlob
setting. SopreferBlob
is orthogonal and its main purpose is to just attach a blob to theImage
/ImageBitmap
to be used byDiscardMissingTileImagePolicy
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but also to send headers. If preferBlob is not set and there are headers with the request, we use a blob.