Convert creates multiple files


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Convert creates multiple files
# 1  
Old 12-10-2018
Convert creates multiple files

I want to crop an image and am using convert


Code:
convert mountain.png -crop 3000x4500 +repage -format png mountain--cr.png

The problem is that convert is creating 4 files



Code:
mountain--cr-0.png
mountain--cr-1.png
mountain--cr-2.png
mountain--cr-3.png

The first is what I need, the other look empty

Last edited by Kangol; 12-10-2018 at 09:34 AM..
# 2  
Old 12-10-2018
Please provide and post full details of your operation system and version of your image utilities.

Thanks.
# 3  
Old 12-10-2018
I am using



Code:
ImageMagick 6.7.7-10 2014-08-28 Q16


My system is GNU Trisquel 7.0 with Gnome Version 3.8.4
# 4  
Old 12-10-2018
Just for fun, have you tried to resize the image before you crop?

Quote:
-resize geometry resize the image
Ref:

https://www.unix.com/man-page/centos/1/convert/
# 5  
Old 12-10-2018
Using the following command did not work, still getting the 4 files.



Code:
convert mountain.png -crop 3000x4500 +repage -format png -resize 3000x4500 mountain--cr.png

# 6  
Old 12-10-2018
Maybe try resizing first, for fun....

Code:
convert mountain.png -resize 3000x4500 mountain-resize.png
convert mountain-resize.png -crop 3000x4500 mountain-resize-crop.png

Or something similar and simple, step-by-step?

Just to see what happens?




Moderator's Comments:
Mod Comment Please use CODE tags as required by forum rules!

Last edited by RudiC; 12-10-2018 at 10:24 AM.. Reason: Added CODE tags.
# 7  
Old 12-10-2018
I have an image with a big canvas, and the image falls within it. I am trying to crop to the size of the actual image.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Grep strings on multiple files and output to multiple files

Hi All, I want to use egrep on multiple files and the results should be output to multiple files. I am using the below code in my shell script(working in Ksh shell). However with this code I am not attaining the desired results. #!/bin/ksh ( a="/path/file1" b="path/file2" for file in... (4 Replies)
Discussion started by: am24
4 Replies

2. Shell Programming and Scripting

Convert single column into multiple rows

Convert Single column to multiple rows file a.txt contains data like below Server=abc Run=1 Tables=10 Sessions=16 Time=380 Jobs=5 Server=abc Run=2 Tables=15 Sessions=16 Time=400 Jobs=5 Server=abc Run=3 Tables=20 Sessions=16 Time=450 (5 Replies)
Discussion started by: sol_nov
5 Replies

3. UNIX for Advanced & Expert Users

Allow user without dir write permission to execute a script that creates files

In our project we have several unix scripts that trigger different processes. These scripts write logs to a particular folder 'sesslogs', create output data files in a separate directory called 'datafiles' etc. Usually L1 support team re-run these scripts . We donot want L1 support team to have... (14 Replies)
Discussion started by: waavman
14 Replies

4. Shell Programming and Scripting

How to convert multiple number ranges into sequence?

Looking for a simple way to convert ranges to a numerical sequence that would assign the original value of the range to the individual numbers that are on the range. Thank you given data 13196-13199 0 13200 4 13201 10 13202-13207 3 13208-13210 7 desired... (3 Replies)
Discussion started by: jcue25
3 Replies

5. Shell Programming and Scripting

awk, multiple files input and multiple files output

Hi! I'm new in awk and I need some help. I have a folder with a lot of files and I need that awk do something in each file and print a new file with the output. The input file name should be modified when I print the outpu files. Thanks in advance for help! :-) ciao (5 Replies)
Discussion started by: gabrysfe
5 Replies

6. UNIX for Dummies Questions & Answers

Using AWK: Extract data from multiple files and output to multiple new files

Hi, I'd like to process multiple files. For example: file1.txt file2.txt file3.txt Each file contains several lines of data. I want to extract a piece of data and output it to a new file. file1.txt ----> newfile1.txt file2.txt ----> newfile2.txt file3.txt ----> newfile3.txt Here is... (3 Replies)
Discussion started by: Liverpaul09
3 Replies

7. Shell Programming and Scripting

Cannot get to convert multiple spaces to one space

Hi Guys, I am using a Redhat Linux Centos machine and trying to convert multiple spaces in a file to one space. I am using: sed '/./,/^$/!d' input_file > output_file I also tried cat -s Both gave me no change in the output file. I tried this on cygwin and it worked... (7 Replies)
Discussion started by: npatwardhan
7 Replies

8. UNIX for Dummies Questions & Answers

naming files that csplit creates

Hi, This is my first time on this forum.. I searched the previous answers, but didn't find the answer I was looking for at first glance. csplit works beautifully for me, except for one thing. My file looks like this: ad|name1|asdf...(several pages)..asdf ... ad|name2|asdf...(several... (8 Replies)
Discussion started by: juliette salexa
8 Replies

9. UNIX for Dummies Questions & Answers

SCO 5.0.7 Cron creates files with 600, need 644

Hi, I've searched and read, and searched and read some more; but I'm still not connecting the dots or understanding what I need to change. I have a script that creates a file. If I run it as root, the file gets created with 644 permissions like I want. That seems to make sense (at least I... (2 Replies)
Discussion started by: 65bit
2 Replies

10. Windows & DOS: Issues & Discussions

gVim creates and leaves strange tilde ~ files in Windows

Hey folks, I have used gVim in Windows for many years but I have never found an answer to a very simple question I am going to ask you guys... My question is if there is a way to eliminate the creation of those ~ files that gVim creates in Windows. If you have ever used gVim in Windows you... (2 Replies)
Discussion started by: ghbarratt
2 Replies
Login or Register to Ask a Question