}
if (AcquireUniqueFilename(image_info->zero) == MagickFalse)
{
- (void) RelinquishUniqueFileResource(image_info->zero);
+ (void) RelinquishUniqueFileResource(image_info->unique);
ThrowFileException(exception,FileOpenError,
"UnableToCreateTemporaryFile",image_info->zero);
return(MagickFalse);
*/
status=SystemCommand(delegate_info->spawn,image_info->verbose,command,
exception) != 0 ? MagickTrue : MagickFalse;
- if (delegate_info->spawn != MagickFalse)
- (void) sleep(2); /* FUTURE: A better way is needed! */
+ /* If spawn, wait for input file to 'disappear', or maximum 5 secs */
+ if (delegate_info->spawn != MagickFalse) {
+#if 1
+ ssize_t count=50; /* 50 x 0.1 sec sleeps maximum */
+ while( count > 0 && access_utf8(image->filename,F_OK) == 0 )
+ (void) usleep(100000); /* sleep 0.1 seconds */
+#else
+ (void) sleep(2);
+#endif
+ }
command=DestroyString(command);
}
if (LocaleCompare(decode,"SCAN") != 0)
}
p++; /* advance beyond the percent */
- if ( *p == '\0' ) {
- (void) ThrowMagickException(exception,GetMagickModule(),
- OptionWarning,"UnknownImageProperty","\"%%\"");
- p--;
- continue;
- }
-
/*
- Doubled Percent
+ Doubled Percent - or percent at end of string
*/
+ if ( *p == '\0' )
+ p--;
if ( *p == '%' ) {
*q++='%';
continue;
Set option delegate:bimodal=true to process bimodal delegates otherwise they
are ignored.
+
+ If stealth="True" the delegate is not listed in user requested
+ "-list delegate" listings. These are typically special internal delegates.
+
+ If spawn="True" ImageMagick will not way for the delegate to finish,
+ nor will it read any output image. It will only wait for either the input
+ file to be removed (See "ephemeral:" coder) indicating that the input file
+ has been read, or a maximum time limit of 2 seconds.
-->
<delegatemap>
<delegate decode="autotrace" stealth="True" command=""@ConvertDelegate@" "%i" "pnm:%u"\n"@AutotraceDecodeDelegate@" -input-format pnm -output-format svg -output-file "%o" "%u""/>
<delegate decode="blender" command=""@BlenderDecodeDelegate@" -b "%i" -F PNG -o "%o""\n"@ConvertDelegate@" -concatenate "%o*.png" "%o""/>
- <delegate decode="browse" stealth="True" spawn="True" command=""@BrowseDelegate@" http://www.imagemagick.org/"/>
+ <delegate decode="browse" stealth="True" spawn="True" command=""@BrowseDelegate@" http://www.imagemagick.org/; rm "%i""/>
<delegate decode="cdr" command=""@UniconvertorDelegate@" "%i" "%o.svg"; mv "%o.svg" "%o""/>
<delegate decode="cgm" thread-support="False" command=""@CGMDecodeDelegate@" -d ps -oC < "%i" > "%o" 2> "%Z""/>
<delegate decode="dvi" command=""@DVIDecodeDelegate@" -q -o "%o" "%i""/>