Hui G
2017-03-30 16:25:50 UTC
Hi!
I am calculating a jpg file size by parsing it as a binary file with nodejs. The computed width height gives 4032x3024 But when viewing the image in my mac viewer, the inspector indicates a size of 3024x 4032!
Its header 0xFFC0 block is as follow:
ffc0 0011 080b d00f c003
According to JPEG format, sizes should be : height = 0bd0 (i.e:3024) width = 0fc0 (i.e:4032)
(Using Imagemagick identify program confirms this calculation: identify HJ7XFd9le.jpg HJ7XFd9le.jpg JPEG 4032x3024 4032x3024+0+0 8-bit sRGB 380KB 0.000u 0:00.000)
How can i compute the accurate size programmatically by parsing the file as a binary file?
Thanks!
I am calculating a jpg file size by parsing it as a binary file with nodejs. The computed width height gives 4032x3024 But when viewing the image in my mac viewer, the inspector indicates a size of 3024x 4032!
Its header 0xFFC0 block is as follow:
ffc0 0011 080b d00f c003
According to JPEG format, sizes should be : height = 0bd0 (i.e:3024) width = 0fc0 (i.e:4032)
(Using Imagemagick identify program confirms this calculation: identify HJ7XFd9le.jpg HJ7XFd9le.jpg JPEG 4032x3024 4032x3024+0+0 8-bit sRGB 380KB 0.000u 0:00.000)
How can i compute the accurate size programmatically by parsing the file as a binary file?
Thanks!