<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://git.reviewboard.kde.org/r/129929/">https://git.reviewboard.kde.org/r/129929/</a>
     </td>
    </tr>
   </table>
   <br />





<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On febbraio 7th, 2017, 4:10 a.m. CET, <strong>Michael Pyne</strong> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Ship It!</pre>
 </blockquote>




 <p>On febbraio 7th, 2017, 9:05 a.m. CET, <strong>Martin Koller</strong> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">No, that won't work.
I had a mail discussion about this in 2015:</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">On Sunday 10 May 2015 19:39:07 Alex Merry wrote:</p>
<blockquote style="text-rendering: inherit;padding: 0 0 0 1em;border-left: 1px solid #bbb;white-space: normal;margin: 0 0 0 0.5em;line-height: inherit;">
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">On Saturday 09 May 2015 22:54:49 Martin Koller wrote:</p>
<blockquote style="text-rendering: inherit;padding: 0 0 0 1em;border-left: 1px solid #bbb;white-space: normal;margin: 0 0 0 0.5em;line-height: inherit;">
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">I'm working on porting kolourpaint to kf5.
Now I find the following:
KDELIBS4SUPPORT_DEPRECATED_EXPORT QStringList typeForMime(const QString
&mimeType);</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">The comment says: Use QMimeType::name() instead().</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">However this seems incorrect.
typeForMime() returned a format string usable for QImage::save(), e.g.
"image/png" returns "PNG"
QMimeType::name() returns the name of the mime type, which is again
"image/png", which I can not pass to QImage::save()
(typeForMime() gives the X-KDE-ImageFormat field from the desktop file, and
the mime type is in the X-KDE-MimeType field)</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">So, is there a REAL alternative for this method ?</p>
</blockquote>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Ah, you want QMimeType::suffixes() instead, since QImage types are essentially 
file extensions.</p>
</blockquote>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">no, this is not the same.
suffixes() returns a QStringList(!), for instance this would return "jpg", "jpeg" for image/jpeg.
But the QImage::save() method needs exactly ONE specific string as format.
How should my code know which one to use ?</p>
<blockquote style="text-rendering: inherit;padding: 0 0 0 1em;border-left: 1px solid #bbb;white-space: normal;margin: 0 0 0 0.5em;line-height: inherit;">
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">I had plans a while back to submit a patch to Qt to do implement the 
equivalent of typeForMime and its inverse properly (using the data in the 
QImageFormat plugin metadata), but never got round to finishing it. Hopefully 
I'll have the time and energy to pick that up again at some point.</p>
</blockquote>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">I'd say a better solution would be to simply have no need for such a method, e.g.
allow that QImageWriter (QImage, QPimap) accepts a QMimeType.</p></pre>
 </blockquote>





 <p>On giugno 3rd, 2017, 9:27 p.m. CEST, <strong>Martin Tobias Holmedahl Sandsmark</strong> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">My patch doesn't try to guess which one from a QStringList(), that's what the old code does. With this patch it uses preferredSuffix(), which solves the problem.</p></pre>
 </blockquote>








</blockquote>

<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Any update on this? Martin (Koller), the answer from Martin (Sandsmark) seems to address the issue that you raised.</p></pre>
<br />










<p>- Luigi</p>


<br />
<p>On febbraio 6th, 2017, 11:36 p.m. CET, Martin Tobias Holmedahl Sandsmark wrote:</p>








<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: 1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
 <tr>
  <td>

<div>Review request for KDE Graphics and Martin Koller.</div>
<div>By Martin Tobias Holmedahl Sandsmark.</div>


<p style="color: grey;"><em>Updated Feb. 6, 2017, 11:36 p.m.</em></p>









<div style="margin-top: 1.5em;">
 <strong style="color: #575012; font-size: 10pt;">Repository: </strong>
kolourpaint
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">KImageIO is apparently deprecated, so use similar code to what is now used in Gwenview.</p></pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Saving as different formats works as expected here.</p></pre>
  </td>
 </tr>
</table>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>document/kpDocument.cpp <span style="color: grey">(69aa8d83)</span></li>

 <li>document/kpDocument_Open.cpp <span style="color: grey">(7c0be0b4)</span></li>

 <li>document/kpDocument_Save.cpp <span style="color: grey">(1434832a)</span></li>

 <li>document/kpDocument_Selection.cpp <span style="color: grey">(efdd735a)</span></li>

</ul>


<p><a href="https://git.reviewboard.kde.org/r/129929/diff/1/" style="margin-left: 3em;">View Diff</a></p>










  </td>
 </tr>
</table>







  </div>
 </body>
</html>