[Spice-devel] 答复: how to open jpg binary file (/tmp/spice_dump/x.jpg)?
谢 昆明
KunMing.Xie at hotmail.com
Wed Jun 20 09:47:54 UTC 2018
Yes. It is some spice code which is calling dump_jpeg.
After apply this patch, jpeg file can be open by eog.
发送自 Windows 10 版邮件<https://go.microsoft.com/fwlink/?LinkId=550986>应用
发件人: Christophe Fergeau<mailto:cfergeau at redhat.com>
发送时间: 2018年6月20日 17:28
收件人: 谢 昆明<mailto:KunMing.Xie at hotmail.com>
抄送: spice-devel at lists.freedesktop.org<mailto:spice-devel at lists.freedesktop.org>
主题: Re: [Spice-devel] how to open jpg binary file (/tmp/spice_dump/x.jpg)?
Hey,
On Wed, Jun 20, 2018 at 02:14:54AM +0000, 谢 昆明 wrote:
> Hey guys. I have dump some jpg file, but I can’t open it with eog.
I don't understand how this relates to spice? Is this some spice code
which is calling dump_jpeg?
Christophe
>
>
> static int jpeg_id = 0;
> static void dump_jpeg(uint8_t* data, int data_size)
> {
> char file_str[200];
> uint32_t id = ++jpeg_id;
>
> #ifdef WIN32
> sprintf(file_str, "c:\\tmp\\spice_dump\\%u.jpg", id);
> #else
> sprintf(file_str, "/tmp/spice_dump/%u.jpg", id);
> #endif
>
> FILE *f = fopen(file_str, "wb");
> if (!f) {
> return;
> }
>
> fwrite(data, 1, data_size, f);
> fclose(f);
> }
>
>
> 发送自 Windows 10 版邮件<https://go.microsoft.com/fwlink/?LinkId=550986>应用
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20180620/4921cdc6/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-fix-dump-jpeg-error.patch
Type: application/octet-stream
Size: 1197 bytes
Desc: 0001-fix-dump-jpeg-error.patch
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20180620/4921cdc6/attachment-0001.obj>
More information about the Spice-devel
mailing list