adriancooney / console.image

The one thing Chrome Dev Tools didn't need.
1.77k stars 131 forks source link

[feature][suggestion] Scale image for console.image #21

Open guillaumegarcia13 opened 4 years ago

guillaumegarcia13 commented 4 years ago

I have seen console.image takes scale as second argument but it has not the "expected" result as it is cropping the image instead of resizing it.

image

PS: I too experienced the duplicate image as described in #19

SOKHUONG commented 3 years ago

If you don't use cdn, you could edit the script.

  1. Find (this.width*r,this.height*r) in console.image.min.js and change it to (this.width*r,this.height*r/2) OR
  2. Find
    var dim = getBox(this.width * scale, this.height * scale);

    in console.image.js and change it to

    var dim = getBox(this.width * scale, this.height * scale / 2);

    index.html

    
    <!DOCTYPE html>
    <html>
    <head>
    <title>console.image</title>
    </head>
    <body>
    <div class="wrapper">
        <h1>console.image playground. Hit Ctrl/CMD + Shift + J and check it out.</h1>
    </div>


![image](https://user-images.githubusercontent.com/47057680/95668496-f3ebfe80-0b9e-11eb-89aa-7686fef3028c.png)

Cheers!