Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 5

Qt-interest Archive, February 2008
Help! Jpeg plugin is not anymore loading...

Pages: Prev | 1 | 2 | Next

Message 1 in thread

Dear all,
I have a problem : I cannot anymore use the jpeg plugin to load jpeg images.

I am using Qt 4.3.2 under windows
My code should work : it used to work and I did not modify it since.
I recompiled Qt (debug-and-release) for adding the mysql functions (which
work great, and the plugin is loading)

However, when I went back to my jpeg program, it's not loading images
anymore, and if I list the supported image formats, I get
bmp pbm pgm png ppm xbm xpm. This happens both for debug and release builds.

My QTDIR is correctly set (C:\Qt\4.3.2)

Thanks,

Etienne

Message 2 in thread

Hello,
Some pointers for you
- Did you check that the plugin has been built ? (look in the plugin's
subdir)
- Did you verify that it has correctly been loaded in your application
?
-- if so, what error message do you get ?
- Look at the plugin cache, you might have values from your old build
and the new generates new key that can't match with the one you have in
your registry

The doc will be more precise about this :
http://doc.trolltech.com/4.3/plugins-howto.html#the-plugin-cache

Hope this helps
Samuel

>>> "Etienne SandrÃ" <etienne.sandre@xxxxxxxxxxxxxxxxx> 02/27/08 8:41 
>>>
Dear all,
I have a problem : I cannot anymore use the jpeg plugin to load jpeg
images.

I am using Qt 4.3.2 under windows
My code should work : it used to work and I did not modify it since.
I recompiled Qt (debug-and-release) for adding the mysql functions
(which
work great, and the plugin is loading)

However, when I went back to my jpeg program, it's not loading images
anymore, and if I list the supported image formats, I get
bmp pbm pgm png ppm xbm xpm. This happens both for debug and release
builds.

My QTDIR is correctly set (C:\Qt\4.3.2)

Thanks,

Etienne

--
 [ signature omitted ] 

Message 3 in thread

Dear Samuel,

Thanks for your help.
The plugin has been successfully built, the dll is in
%QTDIR%\plugins\imageformats in both release and debug version, with the
correct date. I even tried deleting the plugin dll's and recompiling Qt from
scratch. The plugins are created.

How can I check if the plugin is loaded?

I went to the plugin cache in the registry. All plugins were listed there. I
deleted all the entries and started my application. Now I have only the
"iconengines" plugins listed. So the other plugins are probably not detected
and loaded properly.

Thanks,

Etienne



2008/2/27, Samuel Gaist <Samuel.Gaist@xxxxxxx>:
>
> Hello,
> Some pointers for you
> - Did you check that the plugin has been built ? (look in the plugin's
> subdir)
> - Did you verify that it has correctly been loaded in your application
> ?
> -- if so, what error message do you get ?
> - Look at the plugin cache, you might have values from your old build
> and the new generates new key that can't match with the one you have in
> your registry
>
> The doc will be more precise about this :
> http://doc.trolltech.com/4.3/plugins-howto.html#the-plugin-cache
>
> Hope this helps
> Samuel
>
>

Message 4 in thread

Dear Etienne,

From the doc and i tried it some times ago, you can use 
"QT_DEBUG_PLUGINS" to enable verbose messages to appear when using one.

Did you also verify that you used Q_IMPORT_PLUGIN in your code as well
as set QTPLUGIN in your project file (i know you had the application
working before but sometimes we miss some minor changes).

Cheers,
Samuel

>>> "Etienne SandrÃ" <etienne.sandre@xxxxxxxxxxxxxxxxx> 02/27/08 9:46 
>>>
Dear Samuel,

Thanks for your help.
The plugin has been successfully built, the dll is in
%QTDIR%\plugins\imageformats in both release and debug version, with
the
correct date. I even tried deleting the plugin dll's and recompiling Qt
from
scratch. The plugins are created.

How can I check if the plugin is loaded?

I went to the plugin cache in the registry. All plugins were listed
there. I
deleted all the entries and started my application. Now I have only
the
"iconengines" plugins listed. So the other plugins are probably not
detected
and loaded properly.

Thanks,

Etienne



2008/2/27, Samuel Gaist <Samuel.Gaist@xxxxxxx>:
>
> Hello,
> Some pointers for you
> - Did you check that the plugin has been built ? (look in the
plugin's
> subdir)
> - Did you verify that it has correctly been loaded in your
application
> ?
> -- if so, what error message do you get ?
> - Look at the plugin cache, you might have values from your old
build
> and the new generates new key that can't match with the one you have
in
> your registry
>
> The doc will be more precise about this :
> http://doc.trolltech.com/4.3/plugins-howto.html#the-plugin-cache 
>
> Hope this helps
> Samuel
>
>

--
 [ signature omitted ] 

Message 5 in thread

Don't answer me directly, this might be usefull for somebody else some
day ;-)

QTPLUGIN is indeed used for static linking but you didn't gave any
precision on that matter.

Try to strip down your code so that only the part involved with the
plugin is used, it will be easier to debug.

Good luck
Samuel

>>> "Etienne SandrÃ" <etienne.sandre@xxxxxxxxxxxxxxxxx> 02/27/08 10:05 
>>>
Hi again (And thanks for the fast replies!)

I did not use either QT_DEBUG_PLUGINS & QTPLUGIN, as I thought it was
only
for statically linking the plugins:

From Qt doc:
"To link statically against those plugins, you need to use the
Q_IMPORT_PLUGIN
<http://doc.trolltech.com/4.3/qtplugin.html#Q_IMPORT_PLUGIN>()
macro in your application and you need to add the required plugins to
your
build using QTPLUGIN."

But maybe the doc is not very clear... I thought this was not required
to
load the dll dynamically. I am also 100% sure that my code worked one
day,
but unfortunately I cannot tell you how Qt was compiled that time...

I will try it!

Thanks,

Etienne



2008/2/27, Samuel Gaist <Samuel.Gaist@xxxxxxx>:
>
> Dear Etienne,
>
> From the doc and i tried it some times ago, you can use
> "QT_DEBUG_PLUGINS" to enable verbose messages to appear when using
one.
>
> Did you also verify that you used Q_IMPORT_PLUGIN in your code as
well
> as set QTPLUGIN in your project file (i know you had the application
> working before but sometimes we miss some minor changes).
>
> Cheers,
> Samuel
>
> >>> "Etienne SandrÃ" <etienne.sandre@xxxxxxxxxxxxxxxxx> 02/27/08
9:46
>
> >>>
> Dear Samuel,
>
> Thanks for your help.
> The plugin has been successfully built, the dll is in
> %QTDIR%\plugins\imageformats in both release and debug version, with
> the
> correct date. I even tried deleting the plugin dll's and recompiling
Qt
> from
> scratch. The plugins are created.
>
> How can I check if the plugin is loaded?
>
> I went to the plugin cache in the registry. All plugins were listed
> there. I
> deleted all the entries and started my application. Now I have only
> the
> "iconengines" plugins listed. So the other plugins are probably not
> detected
> and loaded properly.
>
> Thanks,
>
> Etienne
>
>
>
> 2008/2/27, Samuel Gaist <Samuel.Gaist@xxxxxxx>:
> >
> > Hello,
> > Some pointers for you
> > - Did you check that the plugin has been built ? (look in the
> plugin's
> > subdir)
> > - Did you verify that it has correctly been loaded in your
> application
> > ?
> > -- if so, what error message do you get ?
> > - Look at the plugin cache, you might have values from your old
> build
> > and the new generates new key that can't match with the one you
have
> in
> > your registry
> >
> > The doc will be more precise about this :
> > http://doc.trolltech.com/4.3/plugins-howto.html#the-plugin-cache 
> >
> > Hope this helps
> > Samuel
> >
> >
>
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx
with
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/

>
>

--
 [ signature omitted ] 

Message 6 in thread

"Etienne SandrÃ" <etienne.sandre@xxxxxxxxxxxxxxxxx> wrote:
> I have a problem : I cannot anymore use the jpeg plugin to load jpeg images.

Not sure if this applies to you, but I was using just some Qt classes
(e.g. QString) in an application and found out that Qt loads the plugins
from the constructor of Q[Core]Application.  That means in my case some
of the text codecs were not available until I added a QCoreApplication
object to the program.

Stephen

-- 
 [ signature omitted ] 

Message 7 in thread

Stephen Lee wrote:
> Not sure if this applies to you, but I was using just some Qt classes
> (e.g. QString) in an application and found out that Qt loads 
> the plugins
> from the constructor of Q[Core]Application.  That means in my 
> case some
> of the text codecs were not available until I added a QCoreApplication
> object to the program.

The image plugins are loaded when they are first needed. (i.e. when you
first try to load an image)

Samuel Gaist wrote:
> Did you also verify that you used Q_IMPORT_PLUGIN in your code as well
> as set QTPLUGIN in your project file (i know you had the application
> working before but sometimes we miss some minor changes).

Q_IMPORT_PLUGIN is only needed for statically linking. 

Etienne, are you statically linking the Qt? Then the last release
changed the behaviour. From the changelog:
http://trolltech.com/developer/notes/changes/changes-4.3.4
- QApplication
    * [193842] Fixed a bug where a statically built Qt would still try
      to load Qt plugins (such as style, imageformat, and sqldriver
      plugins) which causes the application to crash.

If you were statically linking Qt and were using image plugins
dynamically (which seemed to work "somehow", but did lead to other
problems) you'll have to make sure that you are now also statically
linking the plugins you need.

Cheers,
Peter

--
 [ signature omitted ] 

Message 8 in thread

Dear Peters,

Thanks confirming that Q_IMPORT_PLUGIN is only required for static linking!
In many posts in this lists it is reported to be mandatory for using the
plugins in any case, which is not what the doc says.

I have always been using shared libraries (ie no static linking) with no
plugin import at all, and everything was working well with jpegs. Now, the
plugins are not loading anymore, and if I clear the plugin cache registry
settings, they are not added to registry. They are present in
%QTDIR%/plugins/imageformats however, with date corresponding to when I last
compiled Qt.

Maybe Q_IMPORT_PLUGIN will make it work by statically linking the jpeg
plugin, but I feel this is more a hack without really understanding what
really happens with dll load...

So I'm still trying to solve this dll loading issues

Any help appreciated!

Thanks,

Etienne



2008/2/27, Peter Prade <prade@xxxxxxxxxxx>:
>
> Stephen Lee wrote:
> > Not sure if this applies to you, but I was using just some Qt classes
> > (e.g. QString) in an application and found out that Qt loads
> > the plugins
> > from the constructor of Q[Core]Application.  That means in my
> > case some
> > of the text codecs were not available until I added a QCoreApplication
> > object to the program.
>
>
> The image plugins are loaded when they are first needed. (i.e. when you
> first try to load an image)
>
> Samuel Gaist wrote:
> > Did you also verify that you used Q_IMPORT_PLUGIN in your code as well
> > as set QTPLUGIN in your project file (i know you had the application
> > working before but sometimes we miss some minor changes).
>
> Q_IMPORT_PLUGIN is only needed for statically linking.
>
> Etienne, are you statically linking the Qt? Then the last release
> changed the behaviour. From the changelog:
> http://trolltech.com/developer/notes/changes/changes-4.3.4
> - QApplication
>     * [193842] Fixed a bug where a statically built Qt would still try
>       to load Qt plugins (such as style, imageformat, and sqldriver
>       plugins) which causes the application to crash.
>
> If you were statically linking Qt and were using image plugins
> dynamically (which seemed to work "somehow", but did lead to other
> problems) you'll have to make sure that you are now also statically
> linking the plugins you need.
>
> Cheers,
>
> Peter
>
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
>

Message 9 in thread

I did some tests with the mysql plugin. The dll loads and the mysql queries
work like a charm.


I did a minimalist app (QApplication with QWidget) that loads a .jpg into a
QImage, and it still fails : the dll is not loaded, and jpg is not listed in
the supported image formats

Cheers,

Etienne

Message 10 in thread

What development environment are you using?

Visual Studio shows me which .dll files are loaded in the Output window, this includes Qt plugins. Can you see if it loads the image plugins? I'm guessing not, although i have no idea why the mysql plugin is found, while the image plugins are not.

can you confirm that the mysql is loaded from the location you're assuming?

Cheers,
Peter 

> -----Ursprüngliche Nachricht-----
> Von: etienne.sandre.chardonnal@xxxxxxxxx 
> [mailto:etienne.sandre.chardonnal@xxxxxxxxx] Im Auftrag von 
> Etienne Sandré
> Gesendet: Mittwoch, 27. Februar 2008 14:52
> An: qt-interest@xxxxxxxxxxxxx
> Betreff: Re: Help! Jpeg plugin is not anymore loading...
> 
> I did some tests with the mysql plugin. The dll loads and the 
> mysql queries work like a charm.
> 
> 
> I did a minimalist app (QApplication with QWidget) that loads 
> a .jpg into a QImage, and it still fails : the dll is not 
> loaded, and jpg is not listed in the supported image formats
> 
> Cheers,
> 
> Etienne
> 
> 

--
 [ signature omitted ] 

Message 11 in thread

I am using MinGW.

However, if I clear the plugin lookup cache in registry, start a Qt App, and
look the plugin cache, I can see which plugins are found. Previously, all
plugins were registered there. Now, I have only the iconengines and
sqldrivers plugins.

If I launch an app without mysql, they are not added (this confirms the
load-at-first-use theory)

The path in the registry plugin cache is the proper one
(C:\Qt\4.3.2\plugins\sqldriver\qsqlmysqld4.dll)

I will try this on another machine tonight (with the same code and the same
Qt version) cause this is getting me mad...


Etienne


2008/2/27, Etienne Sandrà <etienne.sandre@xxxxxxxxxxxxxxxxx>:
>
> I am using MinGW.
>
> However, if I clear the plugin lookup cache in registry, start a Qt App,
> and look the plugin cache, I can see which plugins are found. Previously,
> all plugins were registered there. Now, I have only the iconengines and
> sqldrivers plugins.
>
> If I launch an app without mysql, they are not added (this confirms the
> load-at-first-use theory)
>
> The path in the registry plugin cache is the proper one
> (C:\Qt\4.3.2\plugins\sqldriver\qsqlmysqld4.dll)
>
> I will try this on another machine tonight (with the same code and the
> same Qt version) cause this is getting me mad...
>
>
> Etienne
>
>
>
> 2008/2/27, Peter Prade <prade@xxxxxxxxxxx>:
> >
> > What development environment are you using?
> >
> > Visual Studio shows me which .dll files are loaded in the Output window,
> > this includes Qt plugins. Can you see if it loads the image plugins? I'm
> > guessing not, although i have no idea why the mysql plugin is found, while
> > the image plugins are not.
> >
> > can you confirm that the mysql is loaded from the location you're
> > assuming?
> >
> > Cheers,
> > Peter
> >
> > > -----UrsprÃngliche Nachricht-----
> > > Von: etienne.sandre.chardonnal@xxxxxxxxx
> > > [mailto:etienne.sandre.chardonnal@xxxxxxxxx] Im Auftrag von
> > > Etienne SandrÃ
> > > Gesendet: Mittwoch, 27. Februar 2008 14:52
> > > An: qt-interest@xxxxxxxxxxxxx
> > > Betreff: Re: Help! Jpeg plugin is not anymore loading...
> >
> > >
> > > I did some tests with the mysql plugin. The dll loads and the
> > > mysql queries work like a charm.
> > >
> > >
> > > I did a minimalist app (QApplication with QWidget) that loads
> > > a .jpg into a QImage, and it still fails : the dll is not
> > > loaded, and jpg is not listed in the supported image formats
> > >
> > > Cheers,
> > >
> > > Etienne
> > >
> > >
> >
> >
> > --
> > To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> > "unsubscribe" in the subject or the body.
> > List archive and information: http://lists.trolltech.com/qt-interest/
> >
> >
>

Message 12 in thread

Hello, on 27.02.2008 8:41 Uhr Etienne Sandré said the following:
> Dear all,
> I have a problem : I cannot anymore use the jpeg plugin to load jpeg images.
> 
> I am using Qt 4.3.2 under windows
> My code should work : it used to work and I did not modify it since.
> I recompiled Qt (debug-and-release) for adding the mysql functions 
> (which work great, and the plugin is loading)
> 
> However, when I went back to my jpeg program, it's not loading images 
> anymore, and if I list the supported image formats, I get
> bmp pbm pgm png ppm xbm xpm. This happens both for debug and release builds.
> 
> My QTDIR is correctly set (C:\Qt\4.3.2)

I spent recently several hours to find out that you need to name the 
environment variable "QTDir", not "QTDIR". It looks like that just the 
JPEG-plugin uses the variable in a case sensitive way. All other plugins 
seem the work fine with "QTDIR".

--
 [ signature omitted ] 

Message 13 in thread

Then you should report this as a bug to qt-bugs@xxxxxxxxxxxxx, so they can fix it.

However i doubt QTDIR (however you spell it) is needed at all in Qt 4.x

Cheers,
Peter

> -----Ursprüngliche Nachricht-----
> Von: Thomas Rauscher [mailto:tr-lists@xxxxxxxxxxx] 
> Gesendet: Mittwoch, 27. Februar 2008 17:09
> An: qt-interest@xxxxxxxxxxxxx
> Betreff: Re: Help! Jpeg plugin is not anymore loading...
> 
> Hello, on 27.02.2008 8:41 Uhr Etienne Sandré said the following:
> > Dear all,
> > I have a problem : I cannot anymore use the jpeg plugin to 
> load jpeg images.
> > 
> > I am using Qt 4.3.2 under windows
> > My code should work : it used to work and I did not modify it since.
> > I recompiled Qt (debug-and-release) for adding the mysql functions 
> > (which work great, and the plugin is loading)
> > 
> > However, when I went back to my jpeg program, it's not 
> loading images 
> > anymore, and if I list the supported image formats, I get
> > bmp pbm pgm png ppm xbm xpm. This happens both for debug 
> and release builds.
> > 
> > My QTDIR is correctly set (C:\Qt\4.3.2)
> 
> I spent recently several hours to find out that you need to name the 
> environment variable "QTDir", not "QTDIR". It looks like that 
> just the 
> JPEG-plugin uses the variable in a case sensitive way. All 
> other plugins 
> seem the work fine with "QTDIR".
> 
> --
> MfG,
>       Thomas
> 
> --
> To unsubscribe - send a mail to 
> qt-interest-request@xxxxxxxxxxxxx with "unsubscribe" in the 
> subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
> 
> 

--
 [ signature omitted ] 

Message 14 in thread

Hi,

> I spent recently several hours to find out that you need to name the 
> environment variable "QTDir", not "QTDIR". It looks like that just the 
> JPEG-plugin uses the variable in a case sensitive way. All other plugins 
> seem the work fine with "QTDIR".

As far as I know, 'QTDIR' is not used by the plugin system. It's also the 
first time I hear about this 'QTdir' issue.

I think something else must have triggered/solved this problem.

--
 [ signature omitted ] 

Message 15 in thread

Hi all,

This is really turning me mad...

1) I reinstalled a clean out of the box Qt installation (tried with 4.3.2and
4.3.4)
2) I made a minimal qt eclipse wizard app with only a ui. I edited the ui
with designer to add a toolbar with a few buttons, png and jpg. I added no
code at all. And guess what? png's are displayed, and jpg's are not.

The base wizard code for the app looks definitely sane (I can post it if you
want to look at it) but no way, it's not working.

There is definitely something sucking in the factory plugin loading
mechanism.
I will definitely look toward using libjpeg directly...

Etienne




2008/2/27, Dimitri <dimitri@xxxxxxxxxxxxx>:
>
> Hi,
>
>
> > I spent recently several hours to find out that you need to name the
> > environment variable "QTDir", not "QTDIR". It looks like that just the
> > JPEG-plugin uses the variable in a case sensitive way. All other plugins
> > seem the work fine with "QTDIR".
>
>
> As far as I know, 'QTDIR' is not used by the plugin system. It's also the
> first time I hear about this 'QTdir' issue.
>
> I think something else must have triggered/solved this problem.
>
> --
>
> Dimitri
>
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
>

Pages: Prev | 1 | 2 | Next