Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F5506
pyxcf
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
•
bzimport
Nov 21 2014, 10:31 PM
2014-11-21 22:31:18 (UTC+0)
Size
592 B
Referenced Files
None
Subscribers
None
pyxcf
View Options
#!/usr/bin/python
import
sys
try
:
import
gtk.gdk
except
:
print
'GDK not found.
\n
'
exit
(
1
)
sys
.
argv
.
pop
(
0
)
# we don't need 'python'
for
i
in
range
(
0
,
len
(
sys
.
argv
)):
if
sys
.
argv
[
i
]
==
'-i'
:
input_path
=
sys
.
argv
[
i
+
1
]
if
sys
.
argv
[
i
]
==
'-o'
:
output_path
=
sys
.
argv
[
i
+
1
]
if
sys
.
argv
[
i
]
==
'-w'
:
width
=
int
(
sys
.
argv
[
i
+
1
])
if
sys
.
argv
[
i
]
==
'-h'
:
# seems to be useless
height
=
int
(
sys
.
argv
[
i
+
1
])
try
:
image
=
gtk
.
gdk
.
pixbuf_new_from_file_at_size
(
input_path
,
width
,
height
)
image
.
save
(
output_path
,
'png'
)
except
:
print
'Something is wrong. Check the arguments.
\n
'
exit
(
1
)
File Metadata
Details
Attached
Mime Type
text/x-python
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5063
Default Alt Text
pyxcf (592 B)
Attached To
Mode
T19959: Inline rendering/thumbnailing for Gimp XCF images
Attached
Detach File
Event Timeline
Log In to Comment