简体   繁体   中英

Is it possible to display .bin image files on a web page without converting it to jpg/png/gif?

I am able to view the .bin image files using display command in ImageMagick.

display -size 512x512 -depth 32 -equalize gray:<filename>

I was able to convert it to jpg format and then display on a webpage. But I need to display the file without converting it to jpg.

Using php exec() , it was possible to display the file when running the php file on terminal but not on apache web server. Is there a way to display the .bin image file on a web page? Please help me as I have been trying this for many days...

No.

The gray: protocol will only output an image data blob. There is no image headers, and various important meta-data (like size, depth, & etc) are not communicated/transported.

Even display requires you to, at minimum, specify size + depth before it can read the .bin file.

However, if you can communicate the depth & width to the web browser, you can rebuild the image with Javascript & <canvas> tag. But that would be labor intensive, and the load-time results would be unpleasant for end-users.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM