Skip to content

Commit

Permalink
Use different method for defining number_of_bytes_per_component.
Browse files Browse the repository at this point in the history
  • Loading branch information
hsorby committed Jul 23, 2024
1 parent be53a6a commit 2f6db9f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/general/image_utilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ Utilities for handling images.
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include <algorithm>
#include <math.h>
#include <stddef.h>
#include <stdlib.h>
Expand Down Expand Up @@ -5643,7 +5642,7 @@ Extracts parameters from <magick_image> that matter for a Cmgui_image
*number_of_components = 3;
}
}
*number_of_bytes_per_component = (magick_image->depth == 0) ? 0 : std::max(1, int(magick_image->depth/8));
*number_of_bytes_per_component = (magick_image->depth + 7) / 8;
DestroyExceptionInfo(magick_exception);
return_code = 1;
}
Expand Down

0 comments on commit 2f6db9f

Please sign in to comment.