Huge file resizing and converting without sudo

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
marion
Posts: 3
Joined: 2020-01-14T06:29:51-07:00
Authentication code: 1152

Huge file resizing and converting without sudo

Post by marion »

Hi,

I wonder if there is a way to convert and/or resize a huge TIFF file (1,6GiB), without changing settings on policy.xml. Indeed, I don't have sudo superpowers, and it's impossible to modify this file without it.

The goal here is to implement a bash script which can resize and convert theses TIFF files on any computer, using ImageMagik. but I don't know if it's possible...

Can you help me ? :)
Thanks a lot !

Marion

snibgo
Posts: 12904
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Huge file resizing and converting without sudo

Post by snibgo »

The file size in bytes is not relevant. The important number is the size in pixels. The memory requirement varies, but around 8 bytes per pixel.

If your policy.xml prevents reading that many pixels or using that much memory or disk, the only fix is to edit policy.xml.

Other tools (eg tiffcrop) may be able to break a large tiff into small pieces.
snibgo's IM pages: im.snibgo.com

marion
Posts: 3
Joined: 2020-01-14T06:29:51-07:00
Authentication code: 1152

Re: Huge file resizing and converting without sudo

Post by marion »

Thank you a lot for your (quick) reply !!

Here is the size in pixel of the file :

$ identify image.tif
image.tif TIFF 24240x24240 24240x24240+0+0 8-bit sRGB 1.64193GiB 0.010u 0:00.000

Seems to be 24k pixel on both sides. Doest it means that I need to have 36864000000 bytes of free memory ?!?

I'm gonna give a look on tiffcrop, thank you a lot

snibgo
Posts: 12904
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Huge file resizing and converting without sudo

Post by snibgo »

By my calculation: 24240*24240*8/1e9 = 4.7 GB. That is for 4 channels @ 16 bytes/channel/pixel (integer). That is just to read the image.

If you don't have that much free memory, IM will use disk, which is far slower.
snibgo's IM pages: im.snibgo.com

marion
Posts: 3
Joined: 2020-01-14T06:29:51-07:00
Authentication code: 1152

Re: Huge file resizing and converting without sudo

Post by marion »

Ok, I was wrong for the maths :lol: I squared the results of "24240*8".

So the only solution I have without touching policy.xml file is using tiffcrop to cut my file into pieces, then resize them before put them back together.

I'll try that.
Thank you a lot for your help !!

Post Reply