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

Minor GIMP protocol fix #17909

Merged
merged 1 commit into from
Dec 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/common/gimp.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ gboolean dt_export_gimp_file(const dt_imgid_t imgid)
NULL, // icc_filename
DT_INTENT_PERCEPTUAL,
NULL); // &metadata
fprintf(stdout, "<<<gimp\n%s%s\n", path, thumb ? ".jpg" : ".exr");
printf("<<<gimp\n%s%s\n", path, thumb ? ".jpg" : ".exr");
if(thumb)
{
dt_image_t *image = dt_image_cache_get(darktable.image_cache, imgid, 'r');
fprintf(stdout, "%i %i\n", image->width, image->height);
printf("%i %i\n", image->width, image->height);
dt_image_cache_read_release(darktable.image_cache, image);
}
fprintf(stdout, "gimp>>>\n");
printf("gimp>>>\n");
return TRUE;
}

Expand Down
13 changes: 9 additions & 4 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,16 @@ int main(int argc, char *argv[])
g_setenv("GTK_CSD", "0", TRUE);
#endif

if(dt_init(argc, argv, TRUE, TRUE, NULL)) exit(1);
if(dt_init(argc, argv, TRUE, TRUE, NULL))
{
if(darktable.gimp.mode)
printf("\n<<<gimp\nerror\ngimp>>>\n");
exit(1);
}

if(dt_check_gimpmode_ok("version"))
{
fprintf(stdout, "\n<<<gimp\n%d\ngimp>>>\n", DT_GIMP_VERSION);
printf("\n<<<gimp\n%d\ngimp>>>\n", DT_GIMP_VERSION);
exit(0);
}

Expand All @@ -117,7 +122,7 @@ int main(int argc, char *argv[])
|| (dt_check_gimpmode("thumb") && !dt_check_gimpmode_ok("thumb"))
|| darktable.gimp.error)
{
fprintf(stdout, "\n<<<gimp\nerror\ngimp>>>\n");
printf("\n<<<gimp\nerror\ngimp>>>\n");
exit(1);
}

Expand All @@ -143,7 +148,7 @@ int main(int argc, char *argv[])
dt_cleanup();

if(darktable.gimp.mode && darktable.gimp.error)
fprintf(stdout, "\n<<<gimp\nerror\ngimp>>>\n");
printf("\n<<<gimp\nerror\ngimp>>>\n");

#ifdef _WIN32
if(redirect_output)
Expand Down
Loading