dousao2186 2013-08-27 19:25
浏览 112

使用fancybox显示blob图像的问题

I am trying to use fancybox to display images. My images are blobs inside a mysql db.

Here is the html/php I am using:

<a class="fancybox-buttons" data-fancybox-group="g1" href="data:image/jpeg;base64,<?php echo base64_encode($pic['screenshot']); ?>"><img src="data:image/jpeg;base64,<?php echo base64_encode($pic['screenshot']); ?>" width="150px" height="250px"/></a>

this works but I have this weird flickering ghost image problem when the page loads and when I move my mouse over the image.

  • 写回答

3条回答 默认 最新

  • dongmuzhan4705 2013-08-27 20:01
    关注

    I didn't even know what you did was possible. I think a better approach would be to create a script to dynamically server your images...

    so the image src would be "image.php?id=123" and then you would have the image.php serving script ie...

    Serve image with PHP script vs direct loading an image

    I don't know enough about your app but is storing images in the db a good idea..seems like they are going to make the db big fast.

    评论

报告相同问题?

悬赏问题

  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?