Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/unstable'
Browse files Browse the repository at this point in the history
  • Loading branch information
lilith committed Mar 11, 2015
2 parents 7ff6dbd + bcb8bb2 commit b932252
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions slimmage.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@
if (k.match(/^format$/i) && data['webp']) { return d + "format=webp"; }
if (k.match(/^quality/i)) { return d + "quality=" + data['quality']; }

if (k.match(/^w|width|maxwidth$/i)) { return d + k + "=" + c.w;}
if (k.match(/^h|height|maxheight$/i)) { return d + k + "=" + c.h;}
if (k.match(/^(w|width|maxwidth)$/i)) { return d + k + "=" + c.w;}
if (k.match(/^(h|height|maxheight)$/i)) { return d + k + "=" + c.h;}

return p;
},
Expand Down
6 changes: 6 additions & 0 deletions test/spec/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,12 @@ describe('slimmage', function () {
expect(result.src).to.be("im?width=80&height=45&zoom=2"); //But only because how zoom is interpreted.
});

it('should not change the william and harry querystring variables', function(){
var dpr = window.devicePixelRatio || 1;
var result = s.getImageInfo(100/dpr,"im?width=16&william=130&harry=90",0);
expect(result.src).to.be("im?width=160&william=130&harry=90");
});

});

var css_ids = ['twenty_px','twenty_per','two_em','two_cm','two_in'];
Expand Down

0 comments on commit b932252

Please sign in to comment.