hMatoba / piexifjs

Read and modify exif in client-side or server-side JavaScript.
MIT License
572 stars 119 forks source link

Multiple cases in documentation #42

Closed HarelM closed 6 years ago

HarelM commented 6 years ago

Hi, the following documentation has a redundant if == 3: Would be better to write it as switch case... https://piexifjs.readthedocs.io/en/latest/sample.html#generates-rotated-jpeg

...
if (orientation == 2) {
                    x = -canvas.width;
                    ctx.scale(-1, 1);
                } else if (orientation == 3) {
                    x = -canvas.width;
                    y = -canvas.height;
                    ctx.scale(-1, -1);
                } else if (orientation == 3) {
                    x = -canvas.width;
                    y = -canvas.height;
                    ctx.scale(-1, -1);
                } else if (orientation == 4) {
                    y = -canvas.height;
                    ctx.scale(1, -1);
                } else if (orientation == 5)
...
hMatoba commented 6 years ago

Thank you. It will resolve in next version. https://piexifjs.readthedocs.io/en/2.0/sample.html