Retina 2x <lasso-img>#154
Open
oxala wants to merge 1 commit intolasso-js:masterfrom
Open
Conversation
…-img>; Updated tests;
ba253c9 to
f2061f9
Compare
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.
#151
srcset="./path.png"in ;@patrick-steele-idem
After a couple of attempts to do it and process
srcset={"2x": "./path.png"}- i failed and fallen-back to a simpler solution.The problem i couldn't resolve was that
marko/compiler/Builderdidn't like me passing array instead of a singlesrchere (https://github.com/lasso-js/lasso/compare/master...oxala:Lasso-img-Retina?expand=1#diff-bceb7acc917818bc45d3fb926f0dd232R55) and was crashing (with message like arg should be string, Node or null). Even though you said i need to allow arrays insidetaglib/helper-getImageInfo.js, i think it's not the case, since it doesn't even get there, the Builder error comes before that.Solution below adds processed
srcset="./path.pngto the result image in formatsrcset="/static/.../path.png 2x", so >2x are at least presented with 2x image. If there is notsrcseton the lasso-img, then of course nosrcsetpresented in the output.P.S And of course if this implementation can be improved (or if it's complete rubbish) - i would love to hear it.