toTest should be 128 * 128 * 3 to reflect 128 by 128 pixels of 3 bytes each, as would be the file size.
edit: just to add, I think "width = sqrt(filesize/3)" would be a better version for newbies. Even better would be to replace the code altogether.
edit: just to add, I think "width = sqrt(filesize/3)" would be a better version for newbies. Even better would be to replace the code altogether.
Also, taking the 2log and then 2power is a no-op because it doesn't truncate / ceiling in-between the two.
You kind of see where the code was going to, but it never quite made it there.