Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[macOS] photoqt crashes on start on Sonoma / arm64 #19

Open
barracuda156 opened this issue Nov 8, 2023 · 11 comments
Open

[macOS] photoqt crashes on start on Sonoma / arm64 #19

barracuda156 opened this issue Nov 8, 2023 · 11 comments

Comments

@barracuda156
Copy link

I have built now v. 3.4 on Sonoma, however it crashes on launch:

svacchanda@Sergeys-MacBook-Air Develop % /opt/local/bin/photoqt

PhotoQt v3.4
 > Validating configuration... 
QSqlDatabasePrivate::addDatabase: duplicate connection name 'shortcutsdefault', old connection removed.
 >> Done!

zsh: trace trap  /opt/local/bin/photoqt

photoqt-2023-11-08-171122.txt

@luspi
Copy link
Owner

luspi commented Nov 8, 2023

Hi @barracuda156

I'm not too familiar with macOS, but what I can gather from the log file it seems to crash when an unhandled exception is thrown by GraphicsMagick, in particular when querying Magick::CoderInfo. This happens in the file cplusplus/settings/imageformats.cpp on startup when reading in the image formats database. There it does catch all Magick::Exception but from what I understand from the log file it seems like this exception is called MagickLib::ExceptionType on macOS.

Try the following: In the file cplusplus/settings/imageformats.cpp change lines 219 and 393 from } catch(Magick::Exception &) { to } catch(...) { and recompile.

@barracuda156
Copy link
Author

@luspi Thank you for responding! Should I literally leave (...) or something should still go in? Having the former did not seem to help.

I can try disabling whatever is disableable and see if that works to begin with.

@luspi
Copy link
Owner

luspi commented Nov 8, 2023

The three dots act as a catch-all for any exception. If it still crashes with that in place, then try disabling GraphicsMagick in CMake and recompile. If it still crashes that means we're on the wrong path anyways as it must be caused by something else then.

@barracuda156
Copy link
Author

barracuda156 commented Nov 27, 2023

@luspi Sorry for a delay. So, photoqt builds and does not crash on launch when linked to ImageMagick instead of GraphicsMagick (tested on Sonoma/aarch64). So the issue is indeed with GraphicsMagick.

@luspi
Copy link
Owner

luspi commented Dec 4, 2023

Ok, that's great to hear that you got it to work. From the point of view of PhotoQt, the API of both should be identical. I have had issues with GraphicsMagick before, though they had all been with the compilation and not running.

@barracuda156
Copy link
Author

@luspi Since photoqt-legacy is read-only, writing this here: its .desktop file seems to have some issue:

Error in file "/opt/local/share/applications/photoqt.desktop": "vector/x-hpgl" is an invalid MIME type ("vector" is an unregistered media type)
Error in file "/opt/local/share/applications/photoqt.desktop": "vector/x-hpgl2" is an invalid MIME type ("vector" is an unregistered media type)
Error in file "/opt/local/share/applications/photoqt.desktop": " image/pcx" is an invalid MIME type (" image" is an unregistered media type)

@luspi
Copy link
Owner

luspi commented Dec 16, 2023

Thanks, vector/x-hpgl and vector/x-hpgl2 indeed don't actually exist, image/pcx should be image/x-pcx.

barracuda156 added a commit to barracuda156/powerpc-ports that referenced this issue Dec 17, 2023
pmetzger pushed a commit to macports/macports-ports that referenced this issue Dec 17, 2023
@barracuda156
Copy link
Author

@luspi So basically we need to remove one? I did not initially notice image/x-pcx was there already:

image/pcx;image/x-pc-paintbrush;image/x-pcx;application/vnd.palm;

@luspi
Copy link
Owner

luspi commented Dec 20, 2023

Oh, wait, just wondering, why did you take the desktop file from the legacy repository? Running cmake should create the appropriate desktop file with the right mime types for your current build.

@barracuda156
Copy link
Author

@luspi Because this is on 10.6, where we only got Qt4, and the 1.0 legacy version is the last one to support it.

@luspi
Copy link
Owner

luspi commented Dec 21, 2023

Ah, sorry, I knew that...

The mime type entry should look something like this:
MimeType=image/bmp;image/x-bmp;image/x-ms-bmp;image/dds;image/x-dds;image/gif;image/tiff;image/jp2;image/jpx;image/jpeg;image/x-mng;image/vnd.microsoft.icon;image/x-icon;image/picon;image/png;image/x-portable-anymap;image/x-portable-graymap;image/x-xbitmap;image/x-portable-bitmap;image/pbm;image/x-xpixmap;image/x-portable-pixmap;image/svg+xml;image/svg-xml;image/svg;text/xml-svg;image/vnd.wap.wbmp;image/wbm;video/x-mng;image/fits;image/g3fax;image/mat;image/matlab;image/miff;image/x-mono-bitmap;image/x-otb;image/vnd.nokia.ota-bitmap;image/x-palm;image/pcd;image/x-photo-cd;image/vnd.swiftview-pcx;image/x-pc-paintbrush;image/x-pcx;image/x-pict;image/x-pix;image/sfw;image/x-sgi;image/sgi;image/tga;image/x-tga;image/targa;image/x-targa;image/tim;image/vicar;image/x-viff;image/x-wpg;image/wpg;image/x-xwindowdump;image/xwd;image/x-xwd;application/x-stardent-avs;application/x-dr-halo-bitmap;application/x-mtv;application/vnd.palm

If I run this through desktop-file-validate it returns without errors or warnings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants