[Interest] QImage::save forces client to open file before call
alex at golks.de
Thu Nov 21 15:09:33 CET 2013
after switching from 4.3.0 to current 4.8.5 i have seen that doing this:
image.save("goodfilename.tif"); // or whatever supported format
is not working anymore. a bit digging done, i see the relevant code change was
made in 4.5.0:
bool QImageWriter::canWrite() const
if (d->device && !d->handler && (d->handler = createWriteHandlerHelper(d->device, d->format)) == 0)
this first "if" was made last in here in qt versions < 4.5.0, where the device
was opened when not already done BEFORE this if.
now, createWriteHandlerHelper(...) calls QImageIOPlugin::capabilities(...)
after all, which is implemented in every (?) qt image plugin this way or alike:
so the createWriteHandlerHelper() will return false, because the device is not
open, resulting in a failing call to my image.save("goodfilename.tif").
the question now is, why was this change made?
this change is very strange to me, since it renders this convenience function
does anyone have any hints on this?
should i file a bugreport for this, or was this change intended and why?
* printk("Churning and Burning -");
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 198 bytes
Desc: not available
More information about the Interest