p++;
if (*p != '-' && IfMagickFalse(IsPathAccessible(p)) ) {
(void) ThrowMagickException(exception,GetMagickModule(),
- OptionError,"UnableToAcessPath","%s",p);
+ OptionError,"UnableToAccessPath","%s",p);
return((char *) NULL);
}
return(FileToString(p,~0,exception));
}
continue; /* never reached! */
case '&':
- if (LocaleNCompare("<",p+1,4) != 0)
+ if (LocaleNCompare("<",p,4) == 0)
*q++='<', p+=3;
- else if (LocaleNCompare(">",p+1,4) != 0)
+ else if (LocaleNCompare(">",p,4) == 0)
*q++='>', p+=3;
- else if (LocaleNCompare("&",p+1,5) != 0)
+ else if (LocaleNCompare("&",p,5) == 0)
*q++='&', p+=4;
else
*q++=(*p);
*q++=(*p); /* any thing else is 'as normal' */
continue;
}
+ p++; /* advance beyond the percent */
/*
Doubled Percent
*/
- if ( *(p+1) == '%' ) {
+ if ( *p == '%' ) {
*q++=(*p);
- p++;
- }
+ continue;
+ }
/*
Single letter escapes
*/
- if ( *(p+1) != '[' ) {
+ if ( *p != '[' ) {
const char
*value;
/* But only if not preceeded by a number! */
if ( IfMagickTrue(number) ) {
- *q++=(*p); /* do NOT substitute the percent */
+ *q++='%'; /* do NOT substitute the percent */
+ p--; /* back up one */
continue;
}
- p++;
value=GetMagickPropertyLetter(image_info,image,*p, exception);
if (value != (char *) NULL) {
length=strlen(value);
extent+=length;
interpret_text=(char *) ResizeQuantumMemory(interpret_text,
extent+MaxTextExtent,sizeof(*interpret_text));
- if (interpret_text == (char *) NULL) {
- value=DestroyString((char *)value);
+ if (interpret_text == (char *) NULL)
return((char *)NULL);
- }
q=interpret_text+strlen(interpret_text);
}
(void) CopyMagickString(q,value,extent);
depth;
/* get the string framed by the %[...] */
- p+=2; /* advance p to just inside the opening brace */
+ p++; /* advance p to just inside the opening brace */
depth=1;
if ( *p == ']' ) {
(void) ThrowMagickException(exception,GetMagickModule(),
pattern[64] = '\0';
}
(void) ThrowMagickException(exception,GetMagickModule(),
- OptionError,"UnbalancedBraces","\"%%[%s]\"",pattern);
- break; /* exit loop */
+ OptionError,"UnbalancedBraces","\"%%[%s\"",pattern);
+ interpret_text=DestroyString(interpret_text);
+ return((char *)NULL);
}
/*
- Special Properity Prefixes
+ Special Property Prefixes
such as: %[exif:...] %[fx:...] %[pixel:...]
Otherwise a free-form properity string
*/
extent+=length;
interpret_text=(char *) ResizeQuantumMemory(interpret_text,
extent+MaxTextExtent,sizeof(*interpret_text));
- if (interpret_text == (char *) NULL) {
- value=DestroyString((char *)value);
+ if (interpret_text == (char *) NULL)
return((char *)NULL);
- }
q=interpret_text+strlen(interpret_text);
}
(void) CopyMagickString(q,value,extent);
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
-% SetImageProperty() saves teh given string value either to specific known
+% SetImageProperty() saves the given string value either to specific known
% attribute or to a freeform properity string.
%
% Attempting to set a properity that is normally calculated will produce
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
-% AcquireString() allocates memory for a string and copies the source string
-% to that memory location (and returns it).
+% AcquireString() returns an new extented string, containing a clone of the
+% given string.
%
-% The returned string shoud be freed using DestoryString() or
-% RelinquishMagickMemory() when finished.
+% An extended string is the string length, plus an extra MaxTextExtent space
+% to allow for the string to be activally worked on.
+%
+% The returned string shoud be freed using DestoryString().
%
% The format of the AcquireString method is:
%
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
-% BlobToStringInfo() returns the contents of a blob as a string.
+% BlobToStringInfo() returns the contents of a blob as a StringInfo structure
+% with MaxTextExtent extra space.
%
% The format of the BlobToStringInfo method is:
%
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
-% CloneString() allocates memory for the destination string and copies
-% the source string to that memory location.
-%
-% If source is a NULL pointer the destination will also be set to a NULL
-% point (any existing string is freed). Otherwise the memory is allocated
-% (or resized) and the source string copied into it.
+% CloneString() replaces or frees the destination string to make it
+% a clone of the input string plus MaxTextExtent more space so the string may
+% be worked on on.
%
-% A pointer to the copy of the source string, or NULL is returned.
+% If source is a NULL pointer the destination string will be freed and set to
+% a NULL pointer. A pointer to the stored in the destination is also returned.
%
-% Free the string using DestoryString().
+% When finished the non-NULL string should be freed using DestoryString()
+% or using CloneString() with a NULL pointed for the source.
%
% The format of the CloneString method is:
%
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
-% ConstantString() allocates memory for a string and copies the source string
-% to that memory location (and returns it). Use it for strings that you do
-% do not expect to change over its lifetime.
+% ConstantString() allocates exactly the needed memory for a string and
+% copies the source string to that memory location. A NULL string pointer
+% will allocate an empty string containing just the NUL character.
%
-% When finished free the string using DestoryString().
+% When finished the string should be freed using DestoryString()
%
% The format of the ConstantString method is:
%
% GetPathComponent() returns the parent directory name, filename, basename, or
% extension of a file path.
%
+% The component string pointed to must have at least MaxTextExtent space
+% for the results to be stored.
+%
% The format of the GetPathComponent function is:
%
% GetPathComponent(const char *path,PathType type,char *component)
</message>
</fatalerror>
<warning>
- <message name="UnknownImageProperity">
- unknown image property
- </message>
<message name="InsufficientImageDataInFile">
insufficient image data in file
</message>
<message name="TwoOrMoreImagesRequired">
two or more images required
</message>
- <message name="UnableToAcessPath">
+ <message name="UnableToAccessPath">
unable to access file path
</message>
<message name="UnableToOpenFile">
<message name="NoSuchElement">
no such element in list
</message>
+ <message name="UnknownImageProperty">
+ unknown image property
+ </message>
<message name="UnrecognizedColor">
unrecognized color
</message>
<message name="UnexpectedSamplingFactor">
facteur d'échantillonnage inattendu
</message>
- <message name="UnknownImageProperity">
- image propriété non reconnus
- </message>
<message name="UnknownPatternType">
type de motif inconnu
</message>
<message name="TwoOrMoreImagesRequired">
deux ou plusieurs images nécessaires
</message>
- <message name="UnableToAcessPath">
+ <message name="UnableToAccessPath">
incapables d'accéder chemin du fichier
</message>
<message name="UnableToOpenFile">
<message name="NoSuchElement">
élément absent de la liste
</message>
+ <message name="UnknownImageProperty">
+ image propriété non reconnus
+ </message>
<message name="UnrecognizedColor">
couleur non reconnue
</message>