Applying Clipping Path to high resolution JPG
Swiss army knife of image processing
Brought to you by:
bfriesen
Hello,
I was trying to apply a clipping path on the attached image by calling:
gm convert 1343401.jpg -clip -negate test.jpg
GraphicsMagick library and utility stops working by crashing.
If I try doing it a resized way it works. So this command works fine:
gm convert -size "100x100" 1343401.jpg -clip -negate -resize "100x100>" out.jpg
So it seems to be related to the high pixel width/height.
I tried this on two windows machines (Windows 7 & Windows Server 2008 R2) with GraphicsMagick-1.3.20-Q8-win64
Regards
Lino
I am not able to reproduce this problem on a 64-bit Windows 7 Core2 Quad system with 4GB of RAM using any of the GraphicsMagick 1.3.20 Windows install packages (I tried all four). The expected output was produced in all cases. I ran the same command under 'valgrind' on a Linux system and it did not find any memory access issues.
Can you please post the output of 'gm convert -list resource'?
What type of hardware (memory and CPUs) are you running Windows on?
Hi Bob,
this is the output of "gm convert -list resource":
Resource Limits (Q8, 32 bits/pixel, 64bit address)
Disk: Unlimited (MAGICK_LIMIT_DISK)
Files: 1.5K (MAGICK_LIMIT_FILES)
Map: 6.3GB (MAGICK_LIMIT_MAP)
Memory: 6.3GB (MAGICK_LIMIT_MEMORY)
Pixels: Unlimited (MAGICK_LIMIT_PIXELS)
Threads: 4 (OMP_NUM_THREADS)
Hardware:
Windows7: Intel Core i5-2520M CPU 2x2.50 GHz, 8GB RAM, 4 cores
Windows Server 2008 R2: Intel XEON C5670 2x 2.93 GHz, 12 GB RAM, 24 cores
Last edit: Lino 2014-09-04
The resource listing seems reasonable. I wonder why it works fine for me but not for you? The image dimensions (5760x3840) are not really all that large. It looks like the whole operation will use less than 200MB of memory.
i have dowlnoaded the image from that issue and it worked fine for me. Is it possible that the image gets changed whenn uploading or downloading to this ticket system? Would be new to me. Anyway, I now put the image in a ZIP archieve. Could you try with that one again?
UPDATE: Seems like this portal or the browser strips away some profiles when uploading images.
Last edit: Lino 2014-09-04
Thanks for noticing that SourceForge stripped the profiles from your JPEG upload. I am able to reproduce a whole bunch of problems using your new upload. The problems appear to be in the rendering code, and not related to image size.
As a note (in case I forget later), the SVG for the clip path may be extracted from the image like:
This problem is fixed by Mercurial changeset 14848:d7e7325cec48. The problem was in the vector rendering code (to draw the clip path) which was not taking the image size into account.