<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[QImageReader struggles with some paths]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I'm using a QImageReader to get the image info.<br />
A path to a png ending with the following string works:</p>
<pre><code>/photo/test/Hatsune Miku Project DIVA F_10.png
</code></pre>
<p dir="auto">But the same path with a colon doesn't</p>
<pre><code>/photo/test/Hatsune Miku: Project DIVA F_10.png
</code></pre>
<p dir="auto">The QImageReader::canRead() function returns false and the errorString() returns "File not found".</p>
<p dir="auto">Is there some way around this?</p>
]]></description><link>https://forum.qt.io/topic/138264/qimagereader-struggles-with-some-paths</link><generator>RSS for Node</generator><lastBuildDate>Tue, 22 Sep 2026 17:27:43 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/138264.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 29 Jul 2022 17:24:34 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QImageReader struggles with some paths on Fri, 29 Jul 2022 18:44:53 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/megamouse">@<bdi>Megamouse</bdi></a></p>
<blockquote>
<p dir="auto">Turns out the original path has a FULLWIDTH COLON, while the other one converts it to a regular colon.</p>
</blockquote>
<p dir="auto">...which is exactly what the <strong>stackoverflow</strong> solution talks about...</p>
]]></description><link>https://forum.qt.io/post/723264</link><guid isPermaLink="true">https://forum.qt.io/post/723264</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Fri, 29 Jul 2022 18:44:53 GMT</pubDate></item><item><title><![CDATA[Reply to QImageReader struggles with some paths on Fri, 29 Jul 2022 18:43:18 GMT]]></title><description><![CDATA[<p dir="auto">Yes. I just did.<br />
Turns out the original path has a FULLWIDTH COLON, while the other one converts it to a regular colon.<br />
The QImageReader thus can't find the file.</p>
]]></description><link>https://forum.qt.io/post/723263</link><guid isPermaLink="true">https://forum.qt.io/post/723263</guid><dc:creator><![CDATA[Megamouse]]></dc:creator><pubDate>Fri, 29 Jul 2022 18:43:18 GMT</pubDate></item><item><title><![CDATA[Reply to QImageReader struggles with some paths on Fri, 29 Jul 2022 18:43:02 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/megamouse">@<bdi>Megamouse</bdi></a><br />
I would check again your understanding that your Windows filename contains an embedded <code>:</code> character.</p>
<p dir="auto">For example, try to create such a filename yourself, from a program or Explorer or whatever.</p>
<p dir="auto">Have a read of e.g. <a href="https://stackoverflow.com/questions/10386344/how-to-get-a-file-in-windows-with-a-colon-in-the-filename" target="_blank" rel="noopener noreferrer nofollow ugc">https://stackoverflow.com/questions/10386344/how-to-get-a-file-in-windows-with-a-colon-in-the-filename</a>.  Could the solution there be relevant to your situation, could it actually be a <code>:</code>-looking character which is not a <code>:</code>?</p>
]]></description><link>https://forum.qt.io/post/723262</link><guid isPermaLink="true">https://forum.qt.io/post/723262</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Fri, 29 Jul 2022 18:43:02 GMT</pubDate></item><item><title><![CDATA[Reply to QImageReader struggles with some paths on Fri, 29 Jul 2022 18:37:03 GMT]]></title><description><![CDATA[<p dir="auto">Did you try to compare the content at the lowest level ?</p>
]]></description><link>https://forum.qt.io/post/723261</link><guid isPermaLink="true">https://forum.qt.io/post/723261</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Fri, 29 Jul 2022 18:37:03 GMT</pubDate></item><item><title><![CDATA[Reply to QImageReader struggles with some paths on Fri, 29 Jul 2022 18:24:36 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sgaist">@<bdi>SGaist</bdi></a> said in <a href="/post/723254">QImageReader struggles with some paths</a>:</p>
<blockquote>
<p dir="auto">How do you get the one that is a std::string ?</p>
</blockquote>
<p dir="auto">It's also not working if the path was created as QString in the first place.<br />
Maybe there's some hidden stuff in QString coming from QFileDialog?</p>
<p dir="auto">The path comes from regular c++ directory scan</p>
]]></description><link>https://forum.qt.io/post/723259</link><guid isPermaLink="true">https://forum.qt.io/post/723259</guid><dc:creator><![CDATA[Megamouse]]></dc:creator><pubDate>Fri, 29 Jul 2022 18:24:36 GMT</pubDate></item><item><title><![CDATA[Reply to QImageReader struggles with some paths on Fri, 29 Jul 2022 18:24:31 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/megamouse">@<bdi>Megamouse</bdi></a><br />
If you are on Windows how is either of those a legal pathname?  [To be clear: Windows doesn't allow <code>:</code> in pathnames.]  I don't know about why <code>stdString</code> makes any difference to the result regardless.</p>
]]></description><link>https://forum.qt.io/post/723257</link><guid isPermaLink="true">https://forum.qt.io/post/723257</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Fri, 29 Jul 2022 18:24:31 GMT</pubDate></item><item><title><![CDATA[Reply to QImageReader struggles with some paths on Fri, 29 Jul 2022 18:18:49 GMT]]></title><description><![CDATA[<p dir="auto">I'm on Windows 11.</p>
<p dir="auto">This is the log:</p>
<pre><code>QString                "C:/Users/Megamouse/Pictures/Hatsune Miku: Project DIVA F_10.png"    canRead true
QString::fromStdString "C:/Users/Megamouse/Pictures/Hatsune Miku: Project DIVA F_10.png"    canRead false
</code></pre>
]]></description><link>https://forum.qt.io/post/723255</link><guid isPermaLink="true">https://forum.qt.io/post/723255</guid><dc:creator><![CDATA[Megamouse]]></dc:creator><pubDate>Fri, 29 Jul 2022 18:18:49 GMT</pubDate></item><item><title><![CDATA[Reply to QImageReader struggles with some paths on Fri, 29 Jul 2022 18:18:42 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">How do you get the one that is a std::string ?</p>
]]></description><link>https://forum.qt.io/post/723254</link><guid isPermaLink="true">https://forum.qt.io/post/723254</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Fri, 29 Jul 2022 18:18:42 GMT</pubDate></item><item><title><![CDATA[Reply to QImageReader struggles with some paths on Fri, 29 Jul 2022 18:15:35 GMT]]></title><description><![CDATA[<p dir="auto">It works if I get the QString from a QFileDialog, even though the QString is identical to the one i got as std::string, converted with QString::fromStdString();</p>
]]></description><link>https://forum.qt.io/post/723253</link><guid isPermaLink="true">https://forum.qt.io/post/723253</guid><dc:creator><![CDATA[Megamouse]]></dc:creator><pubDate>Fri, 29 Jul 2022 18:15:35 GMT</pubDate></item><item><title><![CDATA[Reply to QImageReader struggles with some paths on Fri, 29 Jul 2022 17:51:33 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/megamouse">@<bdi>Megamouse</bdi></a><br />
What platform is this on?</p>
]]></description><link>https://forum.qt.io/post/723252</link><guid isPermaLink="true">https://forum.qt.io/post/723252</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Fri, 29 Jul 2022 17:51:33 GMT</pubDate></item></channel></rss>