ruby - Convert an image to a cur image -


i have created image validation system checks magic number of image , tries validate image. digging google got magic number cursor images here.

00 00 01 00 // .ico format 00 00 02 00 // .cur format 

i have visited many sites converts images .cur images, they're converting ico images not cur images :

2.2.1 :012 > file.open('~/pictures/sample/sora-meliae-matrilineare-mimes-image-x-ico.ico', 'rb').read(9)  => "\x00\x00\x01\x00\t\x00\x00\x00\x00"  2.2.1 :013 > file.open('~/downloads/test.cur', 'rb').read(9)  => "\x00\x00\x01\x00\x01\x00\x00\x00\x00" 

the magic number ico images \x00\x00\x01\x00 , cur images it's \x00\x00\x02\x00. have tried convert command obtain cur image results in ico image:

convert sample.cur test.cur 

so how can authentic cur image testing magic no. \x00\x00\x02\x00? code reference have written blog. help.


Comments