<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Helvetica;
panose-1:2 11 5 4 2 2 2 2 2 4;}
@font-face
{font-family:SimSun;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:DengXian;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:DengXian;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:SimSun;
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
font-size:10.5pt;
font-family:DengXian;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
.MsoChpDefault
{mso-style-type:export-only;}
/* Page Definitions */
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
{page:WordSection1;}
--></style></head><body lang=ZH-CN link=blue vlink="#954F72"><div class=WordSection1><p class=MsoNormal><span lang=EN-US>Fix bug.</span><span lang=EN-US style='font-size:12.0pt'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal>发送自<span lang=EN-US> Windows 10 </span>版<span lang=EN-US><a href="https://go.microsoft.com/fwlink/?LinkId=550986"><span lang=EN-US><span lang=EN-US>邮件</span></span></a></span>应用</p><p class=MsoNormal><span lang=EN-US style='font-size:12.0pt;font-family:SimSun'><o:p> </o:p></span></p><div style='mso-element:para-border-div;border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal style='border:none;padding:0cm'><b>发件人<span lang=EN-US>: </span></b><span lang=EN-US><a href="mailto:fziglio@redhat.com">Frediano Ziglio</a><br></span><b>发送时间<span lang=EN-US>: </span></b><span lang=EN-US>2018</span>年<span lang=EN-US>6</span>月<span lang=EN-US>20</span>日<span lang=EN-US> 18:32<br></span><b>收件人<span lang=EN-US>: </span></b><span lang=EN-US><a href="mailto:KunMing.Xie@hotmail.com"><span lang=EN-US><span lang=EN-US>谢</span></span><span lang=EN-US><span lang=EN-US> </span></span><span lang=EN-US><span lang=EN-US>昆明</span></span></a><br></span><b>抄送<span lang=EN-US>: </span></b><span lang=EN-US><a href="mailto:spice-devel@lists.freedesktop.org">spice-devel@lists.freedesktop.org</a>; <a href="mailto:cfergeau@redhat.com">Christophe Fergeau</a><br></span><b>主题<span lang=EN-US>: </span></b><span lang=EN-US>Re: [Spice-devel] </span>答复<span lang=EN-US>: how to open jpg binary file (/tmp/spice_dump/x.jpg)?</span></p></div><p class=MsoNormal><span lang=EN-US style='font-size:12.0pt;font-family:SimSun'><o:p> </o:p></span></p><p class=MsoNormal align=left style='margin-left:3.75pt;text-align:left'><span lang=EN-US style='font-size:12.0pt;font-family:"Helvetica",sans-serif;color:black'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:3.75pt'><span lang=EN-US style='color:black'> <o:p></o:p></span></p><p class=MsoNormal style='margin-left:3.75pt'><span lang=EN-US style='color:black'>Yes. It is some spice code which is calling dump_jpeg.<o:p></o:p></span></p><p class=MsoNormal style='margin-left:3.75pt'><span lang=EN-US style='color:black'> <o:p></o:p></span></p><p class=MsoNormal style='margin-left:3.75pt'><span lang=EN-US style='color:black'>After apply this patch, jpeg file can be open by eog.<o:p></o:p></span></p><p class=MsoNormal style='margin-left:3.75pt'><span lang=EN-US style='color:black'> <o:p></o:p></span></p><div><p class=MsoNormal align=left style='text-align:left'><span lang=EN-US style='font-size:12.0pt;font-family:"Times New Roman",serif;color:black'>The call is correct. What is wrong is dump_jpeg which should handle all chunks and not assume that pointer<o:p></o:p></span></p></div><div><p class=MsoNormal align=left style='text-align:left'><span lang=EN-US style='font-size:12.0pt;font-family:"Times New Roman",serif;color:black'>is raw data.<o:p></o:p></span></p></div><div><p class=MsoNormal align=left style='text-align:left'><span lang=EN-US style='font-size:12.0pt;font-family:"Times New Roman",serif;color:black'>Thanks for the report.<o:p></o:p></span></p></div><div><p class=MsoNormal align=left style='text-align:left'><span lang=EN-US style='font-size:12.0pt;font-family:"Times New Roman",serif;color:black'>What are you trying to do dumping jpeg images?<o:p></o:p></span></p></div><div><p class=MsoNormal align=left style='text-align:left'><span lang=EN-US style='font-size:12.0pt;font-family:"Times New Roman",serif;color:black'><o:p> </o:p></span></p></div><div><p class=MsoNormal align=left style='text-align:left'><span lang=EN-US style='font-size:12.0pt;font-family:"Times New Roman",serif;color:black'>Frediano<o:p></o:p></span></p></div><div><p class=MsoNormal align=left style='text-align:left'><span lang=EN-US style='font-size:12.0pt;font-family:"Times New Roman",serif;color:black'><o:p> </o:p></span></p></div><blockquote style='border:none;border-left:solid #1010FF 1.5pt;padding:0cm 0cm 0cm 4.0pt;margin-left:3.75pt;margin-top:5.0pt;margin-bottom:5.0pt'><p class=MsoNormal style='margin-left:3.75pt'><span style='color:black'>发送自<span lang=EN-US> Windows 10 </span>版<span lang=EN-US><a href="https://go.microsoft.com/fwlink/?LinkId=550986" target="_blank"><span lang=EN-US><span lang=EN-US>邮件</span></span></a></span>应用<span lang=EN-US><o:p></o:p></span></span></p><p class=MsoNormal style='margin-left:3.75pt'><span lang=EN-US style='font-size:12.0pt;font-family:SimSun;color:black'> </span><span lang=EN-US style='color:black'><o:p></o:p></span></p><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal style='margin-left:3.75pt'><b><span style='color:black'>发件人<span lang=EN-US>: </span></span></b><span lang=EN-US style='color:black'><a href="mailto:cfergeau@redhat.com" target="_blank">Christophe Fergeau</a><br></span><b><span style='color:black'>发送时间<span lang=EN-US>: </span></span></b><span lang=EN-US style='color:black'>2018</span><span style='color:black'>年<span lang=EN-US>6</span>月<span lang=EN-US>20</span>日<span lang=EN-US> 17:28<br></span><b>收件人<span lang=EN-US>: </span></b><span lang=EN-US><a href="mailto:KunMing.Xie@hotmail.com" target="_blank"><span lang=EN-US><span lang=EN-US>谢</span></span><span lang=EN-US><span lang=EN-US> </span></span><span lang=EN-US><span lang=EN-US>昆明</span></span></a><br></span><b>抄送<span lang=EN-US>: </span></b><span lang=EN-US><a href="mailto:spice-devel@lists.freedesktop.org" target="_blank">spice-devel@lists.freedesktop.org</a><br></span><b>主题<span lang=EN-US>: </span></b><span lang=EN-US>Re: [Spice-devel] how to open jpg binary file (/tmp/spice_dump/x.jpg)?<o:p></o:p></span></span></p></div><p class=MsoNormal style='margin-left:3.75pt'><span lang=EN-US style='font-size:12.0pt;font-family:SimSun;color:black'> </span><span lang=EN-US style='color:black'><o:p></o:p></span></p><p class=MsoNormal style='margin-left:3.75pt'><span lang=EN-US style='color:black'>Hey,<o:p></o:p></span></p><p class=MsoNormal style='margin-left:3.75pt'><span lang=EN-US style='color:black'> <o:p></o:p></span></p><p class=MsoNormal style='margin-left:3.75pt'><span lang=EN-US style='color:black'>On Wed, Jun 20, 2018 at 02:14:54AM +0000, </span><span style='color:black'>谢 昆明<span lang=EN-US> wrote:<o:p></o:p></span></span></p><p class=MsoNormal style='margin-left:3.75pt'><span lang=EN-US style='color:black'>> Hey guys. I have dump some jpg file, but I can</span><span style='color:black'>’<span lang=EN-US>t open it with eog.<o:p></o:p></span></span></p><p class=MsoNormal style='margin-left:3.75pt'><span lang=EN-US style='color:black'> <o:p></o:p></span></p><p class=MsoNormal style='margin-left:3.75pt'><span lang=EN-US style='color:black'>I don't understand how this relates to spice? Is this some spice code<o:p></o:p></span></p><p class=MsoNormal style='margin-left:3.75pt'><span lang=EN-US style='color:black'>which is calling dump_jpeg?<o:p></o:p></span></p><p class=MsoNormal style='margin-left:3.75pt'><span lang=EN-US style='color:black'> <o:p></o:p></span></p><p class=MsoNormal style='margin-left:3.75pt'><span lang=EN-US style='color:black'>Christophe<o:p></o:p></span></p><p class=MsoNormal style='margin-left:3.75pt'><span lang=EN-US style='color:black'> <o:p></o:p></span></p><p class=MsoNormal style='margin-left:3.75pt'><span lang=EN-US style='color:black'>> <o:p></o:p></span></p><p class=MsoNormal style='margin-left:3.75pt'><span lang=EN-US style='color:black'>> <o:p></o:p></span></p><p class=MsoNormal style='margin-left:3.75pt'><span lang=EN-US style='color:black'>> static int jpeg_id = 0;<o:p></o:p></span></p><p class=MsoNormal style='margin-left:3.75pt'><span lang=EN-US style='color:black'>> static void dump_jpeg(uint8_t* data, int data_size)<o:p></o:p></span></p><p class=MsoNormal style='margin-left:3.75pt'><span lang=EN-US style='color:black'>> {<o:p></o:p></span></p><p class=MsoNormal style='margin-left:3.75pt'><span lang=EN-US style='color:black'>> char file_str[200];<o:p></o:p></span></p><p class=MsoNormal style='margin-left:3.75pt'><span lang=EN-US style='color:black'>> uint32_t id = ++jpeg_id;<o:p></o:p></span></p><p class=MsoNormal style='margin-left:3.75pt'><span lang=EN-US style='color:black'>> <o:p></o:p></span></p><p class=MsoNormal style='margin-left:3.75pt'><span lang=EN-US style='color:black'>> #ifdef WIN32<o:p></o:p></span></p><p class=MsoNormal style='margin-left:3.75pt'><span lang=EN-US style='color:black'>> sprintf(file_str, "c:\\tmp\\spice_dump\\%u.jpg", id);<o:p></o:p></span></p><p class=MsoNormal style='margin-left:3.75pt'><span lang=EN-US style='color:black'>> #else<o:p></o:p></span></p><p class=MsoNormal style='margin-left:3.75pt'><span lang=EN-US style='color:black'>> sprintf(file_str, "/tmp/spice_dump/%u.jpg", id);<o:p></o:p></span></p><p class=MsoNormal style='margin-left:3.75pt'><span lang=EN-US style='color:black'>> #endif<o:p></o:p></span></p><p class=MsoNormal style='margin-left:3.75pt'><span lang=EN-US style='color:black'>> <o:p></o:p></span></p><p class=MsoNormal style='margin-left:3.75pt'><span lang=EN-US style='color:black'>> FILE *f = fopen(file_str, "wb");<o:p></o:p></span></p><p class=MsoNormal style='margin-left:3.75pt'><span lang=EN-US style='color:black'>> if (!f) {<o:p></o:p></span></p><p class=MsoNormal style='margin-left:3.75pt'><span lang=EN-US style='color:black'>> return;<o:p></o:p></span></p><p class=MsoNormal style='margin-left:3.75pt'><span lang=EN-US style='color:black'>> }<o:p></o:p></span></p><p class=MsoNormal style='margin-left:3.75pt'><span lang=EN-US style='color:black'>> <o:p></o:p></span></p><p class=MsoNormal style='margin-left:3.75pt'><span lang=EN-US style='color:black'>> fwrite(data, 1, data_size, f);<o:p></o:p></span></p><p class=MsoNormal style='margin-left:3.75pt'><span lang=EN-US style='color:black'>> fclose(f);<o:p></o:p></span></p><p class=MsoNormal style='margin-left:3.75pt'><span lang=EN-US style='color:black'>> }<o:p></o:p></span></p><p class=MsoNormal style='margin-left:3.75pt'><span lang=EN-US style='color:black'>> <o:p></o:p></span></p><p class=MsoNormal style='margin-left:3.75pt'><span lang=EN-US style='color:black'>> <o:p></o:p></span></p><p class=MsoNormal style='margin-left:3.75pt'><span lang=EN-US style='color:black'>> </span><span style='color:black'>发送自<span lang=EN-US> Windows 10 </span>版邮件<span lang=EN-US><https://go.microsoft.com/fwlink/?LinkId=550986></span>应用<span lang=EN-US><o:p></o:p></span></span></p></blockquote><p class=MsoNormal style='mso-margin-top-alt:0cm;margin-right:36.0pt;margin-bottom:5.0pt;margin-left:3.75pt'><span lang=EN-US style='color:black'>> <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p></div></body></html>