crop CR2 file

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
tg-timoo

crop CR2 file

Post by tg-timoo »

Hey,

I am trying to crop a CR2 image file. I do not get any error message, but the cropping does not work. Here my code:

mogrify -crop 10x10+10+10 file.CR2
or
mogrify -crop 10x10+10+10 cr2:file.CR2 (with implicit file extension)

Has anyone got an idea why this does not work? I could not find any hints from the image magick documentation if CR2 file modification is maybe limited....

Thanks
Timo
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: crop CR2 file

Post by Bonzo »

Are you just cropping the one image at a time; if so try convert:

Code: Select all

convert file.CR2 -crop 10x10+10+10 output.jpg
Does your setup support CR2 files; try a simple convert from CR2 to jpg

Code: Select all

convert file.CR2 output.jpg
What version are you using?
tg-timoo

Re: crop CR2 file

Post by tg-timoo »

Dear Bonzo,

thank you for your reply! I am using ImageMagick 6.6.2-6!

In general working with CR2 files seem not to be a problem, also conversion to JPG works fine. Converting and then cropping, however, does not apply to my problem, as I need the cropped version of the RAW image file (meaning the CR2 file).

This approach might sound strange, so here the reason for this approach: I am creating an image database with a rather large number of RAW, Jpg and Tiff images with specific exif header and file properties. For testing purposes, I am creating a dummy database that consists of the same file structure and the same image files in a cropped version (1x1 pixel). By that, the size of the database is drastically reduced, but the image properties are still maintained. And here comes to point: I fail in cropping the CR2 file....

If anyone has a suggestion, I would appreciate your help!
Cheers Timo
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: crop CR2 file

Post by Bonzo »

I can not get the crop to work in mogrify either; I tried two methods:

Code: Select all

mogrify -crop 10x10+10+10 -format png *.CR2

mogrify -crop 10x10+10+10 *.CR2
I can get it to work OK with convert and I am using 6.5.9-5
It would be possible to write some code to read the images and use convert instead.

I would report it as a bug in the bug section.
Post Reply