Splash

 Splash.new(src, size, rounded).image
 Image class

 Icon.new(src, size, rounded).image('.path.ext')
 Export image


 Center image
513209
def splash_start
      icon_size = size.min / 5
      img.resize icon_size if img.dimensions.max >= icon_size
      img.combine_options do |o|
        o.gravity 'center'
        o.background bg if bg
        o.extent size.join('x') # "WxH"
      end
    end
541822
function Logo() {
    return _react2.default.createElement(
        'svg',
        { width: '36px', height: '36px', viewBox: '0 0 134 134' },
        _react2.default.createElement(
            'title',
            null,
            'Tether'
        ),
        _react2.default.createElement(
            'defs',
            null,
            _react2.default.createElement('polygon', { id: 'path-1', points: '0.393496659 0 21.930245 0 21.930245 21.5366592 0.393496659 21.5366592 0.393496659 0' }),
            _react2.default.createElement('polygon', { id: 'path-3', points: '0 21.8785746 0 0.341380846 21.5365702 0.341380846 21.5365702 21.8785746 1.14236032e-15 21.8785746' }),
            _react2.default.createElement('polygon', { id: 'path-5', points: '21.8780401 21.8262806 0.341291759 21.8262806 0.341291759 0.289175947 21.8780401 0.289175947' })
        ),
        _react2.default.createElement(
            'g',
            { stroke: 'none', strokeWidth: '1', fill: 'none', 'fill-rule': 'evenodd' },
            _react2.default.createElement(
                'g',
                { transform: 'translate(-192.000000, -954.000000)' },
                _react2.default.createElement(
                    'g',
                    { transform: 'translate(192.000000, 954.000000)' },
                    _react2.default.createElement('path', { d: 'M59.5367483,10.7683742 C59.5367483,16.7158129 54.7153675,21.5367483 48.7679287,21.5367483 C42.8213808,21.5367483 38,16.7158129 38,10.7683742 C38,4.82093541 42.8213808,0 48.7679287,0 C54.7153675,0 59.5367483,4.82093541 59.5367483,10.7683742', id: 'Fill-13', fill: '#8BC34A' }),
                    _react2.default.createElement('path', { d: 'M77.5367483,28.7683742 C77.5367483,34.7158129 72.7158129,39.5367483 66.7683742,39.5367483 C60.8213808,39.5367483 56,34.7158129 56,28.7683742 C56,22.8209354 60.8213808,18 66.7683742,18 C72.7158129,18 77.5367483,22.8209354 77.5367483,28.7683742', id: 'Fill-16', fill: '#8BC34A' }),
                    _react2.default.createElement('path', { d: 'M96.5367483,47.7688196 C96.5367483,53.7162584 91.7158129,58.5371938 85.7683742,58.5371938 C79.8218263,58.5371938 75,53.7162584 75,47.7688196 C75,41.8213808 79.8218263,37 85.7683742,37 C91.7158129,37 96.5367483,41.8213808 96.5367483,47.7688196', id: 'Fill-18', fill: '#8BC34A' }),
                    _react2.default.createElement('path', { d: 'M59.5367483,47.7688196 C59.5367483,53.7162584 54.7153675,58.5371938 48.7679287,58.5371938 C42.8213808,58.5371938 38,53.7162584 38,47.7688196 C38,41.8213808 42.8213808,37 48.7679287,37 C54.7153675,37 59.5367483,41.8213808 59.5367483,47.7688196', id: 'Fill-20', fill: '#8BC34A' }),
                    _react2.default.createElement('path', { d: 'M40.5367483,66.7683742 C40.5367483,72.7158129 35.7158129,77.5367483 29.7683742,77.5367483 C23.8218263,77.5367483 19,72.7158129 19,66.7683742 C19,60.8209354 23.8218263,56 29.7683742,56 C35.7158129,56 40.5367483,60.8209354 40.5367483,66.7683742', id: 'Fill-22', fill: '#8BC34A' }),
                    _react2.default.createElement('path', { d: 'M21.5367483,84.7688196 C21.5367483,90.7158129 16.7158129,95.5371938 10.7683742,95.5371938 C4.82138085,95.5371938 0,90.7158129 0,84.7688196 C0,78.8213808 4.82138085,74 10.7683742,74 C16.7158129,74 21.5367483,78.8213808 21.5367483,84.7688196', id: 'Fill-24', fill: '#8BC34A' }),
                    _react2.default.createElement('path', { d: 'M59.5367483,84.7688196 C59.5367483,90.7158129 54.7153675,95.5371938 48.7679287,95.5371938 C42.8213808,95.5371938 38,90.7158129 38,84.7688196 C38,78.8213808 42.8213808,74 48.7679287,74 C54.7153675,74 59.5367483,78.8213808 59.5367483,84.7688196', id: 'Fill-27', fill: '#03A9F4' }),
                    _react2.default.createElement('path', { d: 'M77.5367483,103.76882 C77.5367483,109.715813 72.7158129,114.537194 66.7683742,114.537194 C60.8213808,114.537194 56,109.715813 56,103.76882 C56,97.8213808 60.8213808,93 66.7683742,93 C72.7158129,93 77.5367483,97.8213808 77.5367483,103.76882', id: 'Fill-29', fill: '#03A9F4' }),
                    _react2.default.createElement('path', { d: 'M96.5367483,122.76882 C96.5367483,128.716258 91.7158129,133.537194 85.7683742,133.537194 C79.8218263,133.537194 75,128.716258 75,122.76882 C75,116.821381 79.8218263,112 85.7683742,112 C91.7158129,112 96.5367483,116.821381 96.5367483,122.76882', id: 'Fill-31', fill: '#03A9F4' }),
                    _react2.default.createElement('path', { d: 'M96.5367483,84.7688196 C96.5367483,90.7158129 91.7158129,95.5371938 85.7683742,95.5371938 C79.8218263,95.5371938 75,90.7158129 75,84.7688196 C75,78.8213808 79.8218263,74 85.7683742,74 C91.7158129,74 96.5367483,78.8213808 96.5367483,84.7688196', id: 'Fill-34', fill: '#03A9F4' }),
                    _react2.default.createElement('path', { d: 'M115.536748,66.7683742 C115.536748,72.7158129 110.715367,77.5367483 104.767929,77.5367483 C98.8213808,77.5367483 94,72.7158129 94,66.7683742 C94,60.8209354 98.8213808,56 104.767929,56 C110.715367,56 115.536748,60.8209354 115.536748,66.7683742', id: 'Fill-36', fill: '#03A9F4' }),
                    _react2.default.createElement('path', { d: 'M133.536748,47.7688196 C133.536748,53.7162584 128.715813,58.5371938 122.768374,58.5371938 C116.821826,58.5371938 112,53.7162584 112,47.7688196 C112,41.8213808 116.821826,37 122.768374,37 C128.715813,37 133.536748,41.8213808 133.536748,47.7688196', id: 'Fill-38', fill: '#03A9F4' })
                )
            )
        )
    );
}
10579
def stage(self, startimage, newimage):
        
        client = utils.get_client()
        cprint('  Copying file from "%s:/%s" \n                 to "%s://%s/"'
               % (self.sourceimage, self.sourcepath, startimage, self.destpath),
               'blue')

        # copy build artifacts from the container if necessary
        cachedir = self._setcache(client)
        cacherelpath = os.path.relpath(cachedir, TMPDIR)

        # if cached file doesn't exist (presumably purged by OS), trigger it to be recreated
        if os.path.exists(cachedir) and not os.path.exists(os.path.join(cachedir, 'content.tar')):
            shutil.rmtree(cachedir)

        if not os.path.exists(cachedir):
            print(' * Creating cache at %s' % cacherelpath)
            container = client.containers.create(self.sourceimage)
            try:
                tarfile_stream, tarfile_stats = container.get_archive(self.sourcepath)
            except docker.errors.NotFound:
                raise errors.MissingFileError(
                        'Cannot copy file "%s" from image "%s" - it does not exist!' %
                        (self.sourcepath, self.sourceimage))

            # write files to disk (would be nice to stream them, haven't gotten it to work)
            tempdir = tempfile.mkdtemp(dir=BUILD_TEMPDIR)
            with open(os.path.join(tempdir, 'content.tar'), 'wb') as localfile:
                for chunk in tarfile_stream:
                    localfile.write(chunk)
            os.mkdir(cachedir)
            os.rename(tempdir, cachedir)
        else:
            print('  Using cached files from %s' % cacherelpath)

        # write Dockerfile for the new image and then build it
        dockerfile = 'FROM %s\nADD content.tar %s' % (startimage, self.destpath)
        with open(os.path.join(cachedir, 'Dockerfile'), 'w') as df:
            df.write(dockerfile)

        buildargs = dict(path=cachedir,
                         tag=newimage,
                         decode=True)
        utils.set_build_cachefrom(self.cache_from, buildargs, client)

        # Build and show logs
        stream = client.api.build(**buildargs)
        try:
            utils.stream_docker_logs(stream, newimage)
        except ValueError as e:
            raise errors.BuildError(dockerfile, e.args[0], build_args=buildargs)
570229
function serveFavicon() {
    let iconType;
    let filePath;

    return function serveFavicon(req, res, next) {
        if (req.path.match(/^\/favicon\.(ico|png)/i)) {
            // CASE: favicon is default
            // confusing: if you upload an icon, it's same logic as storing images
            // we store as /content/images, because this is the url path images get requested via the browser
            // we are using an express route to skip /content/images and the result is a image path
            // based on config.getContentPath('images') + req.path
            // in this case we don't use path rewrite, that's why we have to make it manually
            filePath = imageLib.blogIcon.getIconPath();

            let originalExtension = path.extname(filePath).toLowerCase();
            const requestedExtension = path.extname(req.path).toLowerCase();

            // CASE: custom favicon exists, load it from local file storage
            if (settingsCache.get('icon')) {
                // depends on the uploaded icon extension
                if (originalExtension !== requestedExtension) {
                    return res.redirect(302, urlService.utils.urlFor({relativeUrl: `/favicon${originalExtension}`}));
                }

                storage.getStorage()
                    .read({path: filePath})
                    .then((buf) => {
                        iconType = imageLib.blogIcon.getIconType();
                        content = buildContentResponse(iconType, buf);

                        res.writeHead(200, content.headers);
                        res.end(content.body);
                    })
                    .catch(next);
            } else {
                originalExtension = path.extname(filePath).toLowerCase();

                // CASE: always redirect to .ico for default icon
                if (originalExtension !== requestedExtension) {
                    return res.redirect(302, urlService.utils.urlFor({relativeUrl: '/favicon.ico'}));
                }

                fs.readFile(filePath, (err, buf) => {
                    if (err) {
                        return next(err);
                    }

                    content = buildContentResponse('x-icon', buf);

                    res.writeHead(200, content.headers);
                    res.end(content.body);
                });
            }
        } else {
            return next();
        }
    };
}
1308797
public static Image newActionImage (String path, ClickHandler onClick)
    {
        return newActionImage(path, null, onClick);
    }
940204
public static Container splash(Container container, URL imageURL) {
        if (imageURL != null) {
            return splash(container, Toolkit.getDefaultToolkit().createImage(imageURL));
        }
        return null;
    }
1016368
function image(input) {
        return new Promise(function (valid, invalid) {
            if (input.getAttribute('type') === 'file' && input.getAttribute('accept').indexOf('image') > -1 && _bn_getFile(input) !== false) {
                BunnyFile.getSignature(_bn_getFile(input)).then(function (signature) {
                    if (BunnyFile.isJpeg(signature) || BunnyFile.isPng(signature)) {
                        valid();
                    } else {
                        invalid({ signature: signature });
                    }
                }).catch(function (e) {
                    invalid(e);
                });
            } else {
                valid();
            }
        });
    }
744673
function () {
        var self = this, id = self._id, prefix = self.classPrefix;
        var icon = self.state.get('icon'), image, text = self.state.get('text'), textHtml = '';

        image = self.settings.image;
        if (image) {
          icon = 'none';

          // Support for [high dpi, low dpi] image sources
          if (typeof image != "string") {
            image = window.getSelection ? image[0] : image[1];
          }

          image = ' style="background-image: url(\'' + image + '\')"';
        } else {
          image = '';
        }

        if (text) {
          self.classes.add('btn-has-text');
          textHtml = '<span class="' + prefix + 'txt">' + self.encode(text) + '</span>';
        }

        icon = icon ? prefix + 'ico ' + prefix + 'i-' + icon : '';

        return (
          '<div id="' + id + '" class="' + self.classes + '" tabindex="-1" aria-labelledby="' + id + '">' +
          '<button role="presentation" type="button" tabindex="-1">' +
          (icon ? '<i class="' + icon + '"' + image + '></i>' : '') +
          textHtml +
          '</button>' +
          '</div>'
        );
      }
34300
def _splash():
    """"""
    splash_title = "{pkg} [{version}] - {url}".format(pkg=PKG_NAME,
                                                      version=version, url=PKG_URL)
    log.to_stdout(splash_title, colorf=log.yellow, bold=True)
    log.to_stdout('-' * len(splash_title), colorf=log.yellow, bold=True)
1224561
def process_image(self, decorator):
        
        savefig_dir = self.savefig_dir
        source_dir = self.source_dir
        saveargs = decorator.split(' ')
        filename = saveargs[1]
        # insert relative path to image file in source
        outfile = os.path.relpath(os.path.join(savefig_dir,filename),
                    source_dir)

        imagerows = ['.. image:: %s'%outfile]

        for kwarg in saveargs[2:]:
            arg, val = kwarg.split('=')
            arg = arg.strip()
            val = val.strip()
            imagerows.append('   :%s: %s'%(arg, val))

        image_file = os.path.basename(outfile) # only return file name
        image_directive = '\n'.join(imagerows)
        return image_file, image_directive
422072
function(tag, confImage, callback) {

      grunt.log.subhead(actioning[action] + ' image [' + tag + ']');

      async.waterfall([

      // Step 1: search for a running container with the same image
      function(cb) {
        docker.listContainers({
          all : 1,
        // filters: (action !== 'unpause') ? '{"status":["running"]}' : null
        }, function(err, containers) {

          if (err) {
            return cb(err);
          }

          var container = null;

          for (var c = 0; c < containers.length; c++) {
            if (containers[c].Image.indexOf(utils.qualifiedImageName(tag,
                  options.registry, null)) === 0) {
              container = containers[c];
              break;
            }
          }

          cb(null, container);
        });
      },

      // Step 2: stop it
      function(container, cb) {
        if (container) {
          grunt.log.writeln("Found a matched container, " + action + " it.");

          var dockcontainer = docker.getContainer(container.Id);

          var opts = confImage.options && confImage.options[action] || {};
          dockcontainer[action](opts, function(e, stream) {
            if (stream && stream.readable) {
              stream.setEncoding('utf8');
              stream.on('error', cb);
              stream.on('end', cb);
              stream.on('data', grunt.log.write);
            } else {
              cb(e);
            }

          });
        } else {
          grunt.log.writeln("No matched container with this image.");
          cb(null);
        }
      }, ], callback);

    }
1143152
static Image getIcon(String target) {

        if (target.equalsIgnoreCase("SystemCursor")) {
            return (new ImageIcon(
                CommonSwing.class.getResource("Hourglass.gif")).getImage());
        } else if (target.equalsIgnoreCase("Frame")) {
            return (new ImageIcon(
                CommonSwing.class.getResource("hsqldb.gif")).getImage());
        } else if (target.equalsIgnoreCase("Execute")) {
            return (new ImageIcon(
                CommonSwing.class.getResource("run_exc.gif")).getImage());
        } else if (target.equalsIgnoreCase("StatusRunning")) {
            return (new ImageIcon(
                CommonSwing.class.getResource("RedCircle.gif")).getImage());
        } else if (target.equalsIgnoreCase("StatusReady")) {
            return (new ImageIcon(
                CommonSwing.class.getResource("GreenCircle.gif")).getImage());
        } else if (target.equalsIgnoreCase("Clear")) {
            return (new ImageIcon(
                CommonSwing.class.getResource("Clear.png")).getImage());
        } else if (target.equalsIgnoreCase("Problem")) {
            return (new ImageIcon(
                CommonSwing.class.getResource("problems.gif")).getImage());
        } else if (target.equalsIgnoreCase("BoldFont")) {
            return (new ImageIcon(
                CommonSwing.class.getResource("Bold.gif")).getImage());
        } else if (target.equalsIgnoreCase("ItalicFont")) {
            return (new ImageIcon(
                CommonSwing.class.getResource("Italic.gif")).getImage());
        } else if (target.equalsIgnoreCase("ColorSelection")) {
            return (new ImageIcon(
                CommonSwing.class.getResource("Colors.png")).getImage());
        } else if (target.equalsIgnoreCase("Close")) {
            return (new ImageIcon(
                CommonSwing.class.getResource("Close.png")).getImage());
        } else {
            return (null);
        }
    }
120093
function (o) {
    if (!o.src) {
      throw new Error('src dir missing');
    }

    var opts = _.extend({}, defaults, o);

    var hasStyle = function () {
      return !!opts.style;
    };

    var stream = vfs.src(opts.src)
      .pipe(tile(opts))
      .on('error', handleError())
      .pipe(layout(opts))
      .on('error', handleError())
      .pipe(sprite(opts))
      .on('error', handleError())
      .pipe(ifStream(hasStyle, style(opts)))
      .on('error', handleError())
      .pipe(toVinyl(opts))
      .on('error', handleError())
      .pipe(through2(function (obj, enc, cb) {
        if (obj instanceof Error) {
          cb(obj, null);
        }
        else {
          cb(null, obj);
        }
      }));

    return stream;
  }
248572
function preloadImage(img, onload, onerror) {
            // create new Image object and add to list
            imgList[img.name] = new Image();
            imgList[img.name].onload = onload;
            imgList[img.name].onerror = onerror;
            if (typeof (api.crossOrigin) === "string") {
                imgList[img.name].crossOrigin = api.crossOrigin;
            }
            imgList[img.name].src = img.src + api.nocache;
        }
759
private Image loadImage(Resource path) throws IOException {
		URL url = path.getURL();
		if (url == null) {
			logger.warn("Unable to locate splash screen in classpath at: " + path);
			return null;
		}
		return Toolkit.getDefaultToolkit().createImage(url);
	}
1245966
public static void main(String[] args)
    {
        String splashImage = Splash.getParam(args, SPLASH);
        if ((splashImage == null) || (splashImage.length() == 0))
            splashImage = DEFAULT_SPLASH;
        URL url = Splash.class.getResource(splashImage);
        if (url == null)
            if (ClassServiceUtility.getClassService().getClassFinder(null) != null)
                url = ClassServiceUtility.getClassService().getClassFinder(null).findResourceURL(splashImage, null);
        
        Container container = null;
        Splash.splash(container, url);
        String main = Splash.getParam(args, MAIN);
        if ((main == null) || (main.length() == 0))
            main = ROOT_PACKAGE + "Thin";
        else if (main.charAt(0) == '.')
            main = ROOT_PACKAGE + main.substring(1);
        Splash.invokeMain(main, args);
        Splash.disposeSplash();
    }
1110477
def splash(self):
        
        dirname = os.path.split(os.path.abspath(__file__))[0]
        try:
            splash = open(os.path.join(dirname, "splash"), "r").readlines()
        except IOError:
            return

        width = len(max(splash, key=len))
        y = int(self.y_grid / 2) - len(splash)
        x = int(self.x_grid / 2) - int(width / 2)

        if self.x_grid > width:
            for i, line in enumerate(splash):
                self.win.addstr(y + i, x, line, curses.color_pair(5))