You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
#!/usr/bin/env kjscmd
|
|
|
|
|
|
|
|
var net = new NetAccess( this, 'net' );
|
|
|
|
|
|
|
|
var loc = '/tmp/test.jpg';
|
|
|
|
|
|
|
|
var ret = net.download( 'http://www.kde.org/media/images/kde_logo.jpg', loc );
|
|
|
|
|
|
|
|
if ( ret ) {
|
|
|
|
var mime = net.mimetype( loc );
|
|
|
|
print( "Mimetype = " + mime + '\n' );
|
|
|
|
var img = new Image();
|
|
|
|
img.load( loc );
|
|
|
|
if ( !img.isOk() ) {
|
|
|
|
warn( 'Failed to load image '+loc);
|
|
|
|
return;
|
|
|
|
} else {
|
|
|
|
print( 'Image ' + loc + ' is OK \n' );
|
|
|
|
}
|
|
|
|
var lbl = new TQLabel(this);
|
|
|
|
lbl.pixmap = img.pixmap();
|
|
|
|
lbl.show();
|
|
|
|
}
|
|
|
|
|
|
|
|
net.del( loc );
|
|
|
|
application.exec();
|