Skip to content

Commit

Permalink
support addition Si prefixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristy committed Nov 21, 2022
1 parent a3be60d commit d3acd28
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion MagickCore/resource.c
Expand Up @@ -17,7 +17,7 @@
% September 2002 %
% %
% %
% Copyright @ 2002 ImageMagick Studio LLC, a non-profit organization %
% Copyright @ 1999 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
Expand Down
8 changes: 6 additions & 2 deletions MagickCore/string.c
Expand Up @@ -1081,11 +1081,11 @@ MagickExport ssize_t FormatMagickSize(const MagickSizeType size,
static const char
*bi_units[] =
{
"", "Ki", "Mi", "Gi", "Ti", "Pi", "Ei", "Zi", "Yi", (char *) NULL
"", "Ki", "Mi", "Gi", "Ti", "Pi", "Ei", "Zi", "Yi", "Ri", "Qi", (char *) NULL
},
*traditional_units[] =
{
"", "K", "M", "G", "T", "P", "E", "Z", "Y", (char *) NULL
"", "K", "M", "G", "T", "P", "E", "Z", "Y", "R", "Q", (char *) NULL
};

bytes=1000.0;
Expand Down Expand Up @@ -1315,6 +1315,8 @@ MagickExport double InterpretSiPrefixValue(const char *magick_restrict string,

switch ((int) ((unsigned char) *q))
{
case 'q': e=(-30.0); break;
case 'r': e=(-27.0); break;
case 'y': e=(-24.0); break;
case 'z': e=(-21.0); break;
case 'a': e=(-18.0); break;
Expand All @@ -1335,6 +1337,8 @@ MagickExport double InterpretSiPrefixValue(const char *magick_restrict string,
case 'E': e=18.0; break;
case 'Z': e=21.0; break;
case 'Y': e=24.0; break;
case 'R': e=27.0; break;
case 'Q': e=30.0; break;
default: e=0.0; break;
}
if (e >= MagickEpsilon)
Expand Down

0 comments on commit d3acd28

Please sign in to comment.