So everything looks good, it's able to resize horizontally & vertically. For instance, when i set n as 4, the 3x3 pixel will be enlarged to
However, when i set n to (2 or 3), the pixels become a little weird..
when N = 2,
the hex values when n=2 are shown below. It's a little weird as u can see the padding that was calculated were 2bytes (0x00, 0x00). By right, it should be 3 bytes (0x00, 0x00, 0x00). I really have to clue where i went wrong.
I even went to print the output of the NEW padding and it's 2 bytes.
Here's my code: https://pastebin.com/PAz17HuQ
Thank you so much for helping.