mikolalysenko / ndpack-image

Package an image into a requireable module
MIT License
19 stars 8 forks source link

ndpack completely breaks down on non-square images #5

Open makc opened 6 years ago

makc commented 6 years ago

I was trying to use 1024x512 image with regl, and not only it was rotated by 90 degrees and flipped, but also duplicated in horizontal direction, so I had to add this in the shader to work around:

uv = vec2(uv.y * 0.5, uv.x);

This is even though js output says

module.exports=require('ndpack-image')(1024,512,4,"iVBO...

so proper dimensions are known to ndpack.

makc commented 6 years ago

looking at #1, there may be a connection 🤔

makc commented 6 years ago

oh yes,

$ npm view ndpack-image version 3.0.0

makc commented 6 years ago

duplicated in horizontal direction

I think the image is not duplicated along the x axis but rather half of its data is placed there (every 2nd scan line) - we see lower texture resolution in the output