]> granicus.if.org Git - imagemagick/commitdiff
https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=29850
authorCristy <urban-warrior@imagemagick.org>
Sun, 5 Jun 2016 23:00:17 +0000 (19:00 -0400)
committerCristy <urban-warrior@imagemagick.org>
Sun, 5 Jun 2016 23:00:17 +0000 (19:00 -0400)
MagickCore/image.c
MagickCore/utility.c

index 258bae2cce9647575788bb48f46549423f985e09..c9c718d0d03e640ec5c6cc39713e6df4f18bb6b2 100644 (file)
@@ -1107,7 +1107,7 @@ MagickExport MagickBooleanType CopyImagePixels(Image *image,
         i;
 
       for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
-      { 
+      {
         PixelChannel channel=GetPixelChannelChannel(image,i);
         PixelTrait traits=GetPixelChannelTraits(image,channel);
         PixelTrait source_traits=GetPixelChannelTraits(source_image,channel);
@@ -2674,6 +2674,8 @@ MagickExport MagickBooleanType SetImageInfo(ImageInfo *image_info,
     {
       (void) CopyMagickString(magic,image_info->magick,MagickPathExtent);
       magick_info=GetMagickInfo(magic,sans_exception);
+      GetPathComponent(image_info->filename,CanonicalPath,component);
+      (void) CopyMagickString(image_info->filename,component,MagickPathExtent);
     }
   else
     {
@@ -2687,17 +2689,15 @@ MagickExport MagickBooleanType SetImageInfo(ImageInfo *image_info,
         {
           (void) CopyMagickString(image_info->magick,magic,MagickPathExtent);
           image_info->affirm=MagickTrue;
+          GetPathComponent(image_info->filename,CanonicalPath,component);
+          (void) CopyMagickString(image_info->filename,component,
+            MagickPathExtent);
         }
     }
   sans_exception=DestroyExceptionInfo(sans_exception);
   if ((magick_info == (const MagickInfo *) NULL) ||
       (GetMagickEndianSupport(magick_info) == MagickFalse))
     image_info->endian=UndefinedEndian;
-  if (image_info->affirm != MagickFalse)
-    {
-      GetPathComponent(image_info->filename,CanonicalPath,component);
-      (void) CopyMagickString(image_info->filename,component,MagickPathExtent);
-    }
   if ((image_info->adjoin != MagickFalse) && (frames > 1))
     {
       /*
index 75d4ec41f48aa346c1b441723bd03bf147b1f254..5d47c5e1ee9225dce807b34eaba0a097c8469652 100644 (file)
@@ -1245,7 +1245,7 @@ MagickExport void GetPathComponent(const char *path,PathType type,
           {
             magick_length=(size_t) (p-component+1);
             for (q=component; *(++p) != '\0'; q++)
-              *q=*p;
+              *q=(*p);
             *q='\0';
           }
         break;
@@ -1291,7 +1291,7 @@ MagickExport void GetPathComponent(const char *path,PathType type,
       if (magick_length != 0)
         (void) CopyMagickString(component,path,magick_length);
       else
-        *component = '\0';
+        *component='\0';
       break;
     }
     case RootPath: