Quantcast
Channel: magick Discussions Rss Feed
Viewing all 3693 articles
Browse latest View live

New Post: MagickImage.Write throws MagickCoderWarningException

$
0
0
I am reading two PNGs into two MagickImage instances, calling Merge on a MagickImageCollection of them, and then calling Write on the merged image.

Usually this works fine, but with one pair of images, Write throws a MagickCoderWarningException ("Magick: Not recognizing known sRGB profile that has been edited `...' @ warning/png.c/MagickPNGWarningHandler/1832").

The file is created, and since it is a warning, I trust that the file is correct.

However, if it is just a warning, it seems to me that Write should return a MagickWarningException, like Read, rather than throw it. Otherwise every call to Write needs to be wrapped in a try/catch block, which is the workaround I will use for now.

P.S. Thanks for this great library!

New Post: MagickImage.Write throws MagickCoderWarningException

$
0
0
I made some changes a while ago to make sure Warnings are no longer thrown and raised as an event (MagickImage.Warning). It seems I missed the Write operation. This will be fixed in the next release of Magick.NET

New Post: Overwrite iptc profile

$
0
0
Im trying to overwrite the IPTC profile on an image but it seems to not apply the changes. For example a simple test:
                    using (fs = fnfFotoMedia.Open(FileMode.Open, FileAccess.ReadWrite))
                    {
                        using (MagickImage image = new MagickImage(fs))
                        {

                            var profile = image.GetIptcProfile();
                             // remove the profile
                            image.RemoveProfile(profile.Name);
                            image.Write("C://teste.jpg");
                        }
                    }

                   //open the saved image
                   using (MagickImage image = new MagickImage(new FileInfo("C://teste.jpg").OpenRead()))
                   {
                       var profile = image.GetIptcProfile(); //profile is not null
                   }
What im doing wrong?

New Post: MagickImage.Write throws MagickCoderWarningException

New Post: Overwrite iptc profile

$
0
0
I can reproduce the issue. It looks like a bug in Imagemagick. I will have to investigate this for you.

New Post: CMYK to RGB for JPEG

New Post: CMYK to RGB for JPEG

$
0
0
I checked the source code of GraphicsMagick and they also only convert the colors when there is a source profile. Your 3convert.jpg image is still CMYK and 3convertRGB.jpg only had its colorspace changed and was not converted. It looks too blue on my monitor. With the following code I come really close to your CMYK source image.
using (MagickImage image = new MagickImage("00000003.jpg"))
{
  image.AddProfile(ColorProfile.CoatedFOGRA39);
  image.AddProfile(ColorProfile.SRGB);
  image.Write("00000003.rgb.jpg");
}
The colors will never be the same but the colors of 00000003.rgb.jpg are closer too 00000003.jpg then your 3convertRGB.jpg image. When you look at the bottom 'Sugerdale' logo the color is too red compared with the original image. And the meat on the right is too purple in the centre.

New Post: Convert pdf to png in 64bit

$
0
0
Hi!

I’m new to Magick.net and I need to convert a pdf to png.
I am having an issue when I try to run the application in a 64bit server. The project is done with Visual Studio 2010, I have referenced Magick.NET-AnyCPU and at project‘s properties I have “Any CPU (platform)” and the code is:
   'Lo transformamos a imagen
   Dim settings As New MagickReadSettings()
   settings.Density = New MagickGeometry(300, 300)

   Using images As New MagickImageCollection()
   images.Read("C:\tmp\prueba.pdf”, settings)
          Dim horizontal As MagickImage = images.AppendHorizontally()
          horizontal.Write("C:\tmp\prueba.png”)
   End Using
But, I have the following exception:
   System.TypeInitializationException: Se produjo una excepción en el inicializador de tipo de 'ImageMagick.Types'. ---> System.TypeInitializationException: Se produjo una excepción en el inicializador de tipo de 'ImageMagick.AssemblyHelper'. ---> System.IO.FileNotFoundException: No se puede cargar el archivo o ensamblado 'Magick.NET-Q16-x86.dll' ni una de sus dependencias. No se puede encontrar el módulo especificado.
      en System.Reflection.RuntimeAssembly.nLoadFile(String path, Evidence evidence)
      en System.Reflection.Assembly.LoadFile(String path)
      en ImageMagick.AssemblyHelper.LoadAssembly()
      en ImageMagick.AssemblyHelper..cctor()
      --- Fin del seguimiento de la pila de la excepción interna ---
      en ImageMagick.AssemblyHelper.GetType(String name)
     en ImageMagick.Types..cctor()
      --- Fin del seguimiento de la pila de la excepción interna ---
      en ImageMagick.MagickReadSettings..ctor()
I have installed Ghostscript 9.14 for 64bits, Microsoft Visual C++ 2010 SP1 Redistributable Package (x64) and Visual C++ Redistributable para Visual Studio 2012 (x64).

And I also have tried to change de library to Magick.NET-x64, but I obtain the same result.

Thanks in advance.

New Post: Convert pdf to png in 64bit

$
0
0
It seems your program is not running in 64-bit mode. The AnyCPU version of ImageMagick detects if you are running the program in 32 or 64 bit and loads the library for that architecture. And from your error message it looks like it is trying to load the 32 bit version of Magick.NET. If you are running your application in a website make sure you set 'Enable 32-bit Applications' to 'False' if you want to run in 64-bit mode.

New Post: Overwrite iptc profile

$
0
0
Yes I tried, but got the same results it seems not be writing with the current image profile.
Even if I get the image.GetByteArray() and write a new file with those bytes it wont work. The bytes stays the same before and after I change the profile (actually, not sure if it was supose to change).

New Post: Overwrite iptc profile

$
0
0
I figured out why this is not working. The iptc profile is actually stored inside the 8bim profile. And the changes in the IPTC profiles are not stored in the 8bim profile. I will have to add this feature/fix to ImageMagick for you.

A workaround for now would be to also remove the 8BIM profile. This will create a new 8BIM profile that contains your new iptc profile.

New Post: Custom font from file.

$
0
0
Can I load a font off the file system to write over an image?
Or better yet from a byte array so I can do some caching and what not?

New Post: Custom font from file.

$
0
0
It might be possible to load custom fonts from disk but I will have to look into this for you. Can you post a code sample of how you are writing the text on top of the image and the font file? This will make it easier for me to try to add this feature to Magick.NET. Loading from a byte array is not possible. We are planning to add some sort of internal caching of fonts to ImageMagick but I have no idea when this will be done.

New Post: Resize cause an "Attempted to read or write protected memory"

$
0
0
Hi ..

I have a simple test for generate a thumbnail (i went verify the performance versus GDI+). I am using this code:
  public Image ResizeImage(string imageoriginal , int newWidth, int newHeight)
        {
            ImageMagick.MagickImage img =new ImageMagick.MagickImage(imageoriginal);
            //ImageMagick.MagickGeometry geometry = new ImageMagick.MagickGeometry("90x90!");
            img.Resize(90, 90); //<--- error ocurs here.

            return img.ToBitmap();
}
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

imageoriginal contains an image file (tif, jpg, png, bmp)


I get the last version with nuget.

New Post: Convert PDF to a set of PJPEG files

$
0
0
The way to remove the background is to use the Alpha method, which allows you to passing a settings enum value. Adding the following to a batch process I was running did the trick:
img.BackgroundColor = new MagickColor(Color.White);
img.Alpha(AlphaOption.Remove);
This seems equivalent to what the op was doing in the command line:
convert.exe -colorspace sRGB -interlace line -density 144x144 -quality 100 -resize 500x500 -background white -alpha remove d:\test.pdf d:\test.jpg

New Post: Resize cause an "Attempted to read or write protected memory"

$
0
0
Does this happen for every image? Or do you have a specific image that fails?

New Post: Resize cause an "Attempted to read or write protected memory"

$
0
0
I tried with different jpg.
I attached two.


2014-04-17 15:19 GMT-04:00 dlemstra <[email removed]>:

From: dlemstra

Does this happen for every image? Or do you have a specific image that fails?

Read the full discussion online.

To add a post to this discussion, reply to this email ([email removed])

To start a new discussion for this project, email [email removed]

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com




--
William John Adam Trindade
Trois-Rivières - Québec - Canada

New Post: Resize cause an "Attempted to read or write protected memory"

$
0
0
It seems that your reply to an e-mail about a message I posted is automatically posted here. Contact me through Codeplex to send me your example images or use something like dropbox to share them.

New Post: Resize cause an "Attempted to read or write protected memory"

New Post: Custom font from file.

Viewing all 3693 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>