This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Batch KRA to Jpeg

0

Votes
0
0
Tags: None
(comma "," separated)
cmonaghan
Registered Member
Posts
11
Karma
0

Batch KRA to Jpeg

Tue Jan 03, 2017 5:33 pm
Got like 150 pics this month and have to save 3 at a time. I can't use irfanview or photoshop because they don't support the kra file format.
User avatar
Rog131
Registered Member
Posts
828
Karma
10

Re: Batch KRA to Jpeg

Wed Jan 04, 2017 6:03 pm
cmonaghan wrote:Batch KRA to Jpeg



By https://userbase.kde.org/Krita/Manual/CommandLine
Export

This allows you to quickly convert files via the terminal:

Code: Select all
krita importfilename --export --export-filename exportfilename



krita --help:
Code: Select all
Usage: krita [options] [file(s)]

Options:
  -v, --version                 Displays version information.
  -h, --help                    Displays this help.
  --print                       Only print and exit
  --template                    Open a new document with a template
  --dpi <dpiX,dpiY>             Override display DPI
  --export-pdf                  Only export to PDF and exit
  --export                      Export to the given filename and exit
  --export-filename <filename>  Filename for export/export-pdf

Arguments:
  [file(s)]                     File(s) or URL(s) to open


Wrapping the Krita command to a batch with the 'find':
Code: Select all
find -name '*.kra' -exec krita {} --export --export-filename {}.jpg \;


man find:
Code: Select all
NAME
       find - search for files in a directory hierarchy

SYNOPSIS
       find [-H] [-L] [-P] [-D debugopts] [-Olevel] [starting-point...] [expression]

DESCRIPTION
       This  manual  page documents the GNU version of find.  GNU find searches the direc‐
       tory tree rooted at each given starting-point by evaluating  the  given  expression
       from  left  to right, according to the rules of precedence (see section OPERATORS),
       until the outcome is known (the left hand side is false for  and  operations,  true
       for  or), at which point find moves on to the next file name.  If no starting-point
       is specified, `.' is assumed...


Fixing the file extension with the 'rename' command:
Code: Select all
rename .kra.jpg .jpg *.kra.jpg


man rename:
Code: Select all
NAME
       rename - rename files

SYNOPSIS
       rename [options] expression replacement file...

DESCRIPTION
       rename will rename the specified files by replacing the first occurrence of expres‐
       sion in their name by replacement.
.
.
.
EXAMPLES
...
              rename .htm .html *.htm

       will fix the extension of your html files.



Image


Example files : http://www.peppercarrot.com/en/static6/ ... page=other


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]