if(!(image.load(path)))
{
cout<<"Bild konnte nicht geladen werden.";
}
Wenn ich jetzt den pfad zu einer. bmp Datei angebe, dann wird diese korrekt geladen, nehme ich jedoch eine. jpg datei kommt halt die Narchicht die ich in der if Bedingung angegeben habe. Ich hoffe jemand kann nur helfen.
Loads an image from the file with the given fileName. Returns true if the image was successfully loaded; otherwise returns false.
The loader attempts to read the image using the specified format, e.g., PNG or JPG. If format is not specified (which is the default), the loader probes the file for a header to guess the file format.
The file name can either refer to an actual file on disk or to one of the application's embedded resources. See the Resource System overview for details on how to embed images and other resource files in the application's executable.
Eine oder jede jpeg-Datei? Vielleicht passt bei deiner Beispieldatei irgendwas mit dem header nicht?
hmm versteh ich jetzt nicht so ganz, sry.
Also ich habe einfach den qt installer genommen und den installations ordner beim erstellen des qt projectes angeben
Und auch hier: minimales kompilierbares Beispiel am besten mit einer jpg-Datei.
Abgesehen davon - ist der Pfad auch korrekt (oder ggf. relativ anstatt absolut) und was sagt QImageReader::supportedImageFormats() ?
Das ist komisch das es auch nicht auf dem Build-Rechner funktioniert.
Gibt es aus versehen einen qt.conf in <Qt-Ordner>/bin bzw. steht ggf. was falsches in der Registry ( http://doc.qt.nokia.com/latest/deployme ... ugin-cache ) - einfach mal HKEY_CURRENT_USER\Software\Trolltech\OrganizationDefaults komplett löschen.