Skip to content

Conversation

@ptc-tgamper
Copy link
Contributor

Do not discard image data uri if uri still needed

Do not discard image data uri if uri still needed
return false;
// If image has a uri, and it is not a data uri, use it as filename
if (!image.uri.empty()) {
if (!IsDataURI(image.uri)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now we can end up here with a data URI, so protect against that case

// If the image is encoded as data URI, and the actual image data was
// not extracted, then we keep the original data URI that holds all
// the data.
if (IsDataURI(uri) && ok && image->image.empty()) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep the uri only if the data has not been loaded. Otherwise we have it in memory twice.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant