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

FxImage() multithreading #4654

Closed
snibgo opened this issue Jan 3, 2022 · 1 comment
Closed

FxImage() multithreading #4654

snibgo opened this issue Jan 3, 2022 · 1 comment

Comments

@snibgo
Copy link

snibgo commented Jan 3, 2022

ImageMagick version

v7.1.0-20

Operating system

Windows

Operating system, version and so on

Windows 8.1

Description

In a recent update to fx.c, in FxImage(), the multithreading for the y loop has changed to:

  #pragma omp parallel for schedule(dynamic) shared(progress,status) \
    magick_number_threads(image,fx_image,fx_image->rows, \
      GlobExpression(fx_info[0]->expression,"debug(",MagickTrue) == 0 ? 1 : 0)

However, ...

GlobExpression(fx_info[0]->expression,"debug(",MagickTrue)

... is always false, except for the unusual case where the expression is exactly "debug(", ignoring case. Hence the ternary result is always 1, so multithreading is always enabled.

Perhaps the intention was to use:

GlobExpression(fx_info[0]->expression,"*debug(*",MagickTrue)

... with wildcards '*', so multithreading would be disabled when the expression contained "debug(" anywhere within the string.

Incidentally, I expect to propose a replacement for FxImage() etc in about a week.

Steps to Reproduce

See the code in fx.c FxImage().

Images

N/A

@urban-warrior
Copy link
Member

Your analysis is sound, we will apply a patch. Also, looking forward to reviewing your implementation.

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

No branches or pull requests

3 participants