Shortcode -> <img> markup.  Creates images as necessary.
497205
function shortCode( $_atts, $latex ) {
		$atts = shortcode_atts( array(
		    'size' => 0,
		    'color' => false,
		    'background' => false,
			), $_atts );

		$latex = preg_replace( array( '#<br\s*/?>#i', '#</?p>#i' ), ' ', $latex );

		$latex = str_replace(
			array( '&lt;', '&gt;', '&quot;', '&#8220;', '&#8221;', '&#039;', '&#8125;', '&#8127;', '&#8217;', '&#038;', '&amp;', "\n", "\r", "\xa0", '&#8211;' ),
			array( '<',    '>',    '"',      '``',       "''",     "'",      "'",       "'",       "'",       '&',      '&',     ' ',  ' ',  ' ',    '-' ),
			$latex
		);

		$latex_object = $this->latex( $latex, $atts['background'], $atts['color'], $atts['size'] );

		$url = esc_url( $latex_object->url );
		$alt = esc_attr( is_wp_error( $latex_object->error ) ? $latex_object->error->get_error_message() . ": $latex_object->latex" : $latex_object->latex  );

		return "<img src='$url' alt='$alt' title='$alt' class='latex' />";
	}
935295
def image(self, raw_url, title='', alt=''):
        '''  '''
        max_images = self._config.get('count')
        if max_images is not None and len(self._out.images) >= max_images:
            # We already have enough images, so bail out
            return ' '

        image_specs = raw_url
        if title:
            image_specs += ' "{}"'.format(title)

        alt, container_args = image.parse_alt_text(alt)

        spec_list, _ = image.get_spec_list(image_specs, container_args)

        for spec in spec_list:
            if not spec:
                continue

            self._out.images.append(self._render_image(spec, alt))
            if max_images is not None and len(self._out.images) >= max_images:
                break

        return ' '
588171
function (options, dir, callback) {
  if (_.isObject(options.icon)) {
    createHicolorIcon(options, dir, callback)
  } else if (options.icon) {
    createPixmapIcon(options, dir, callback)
  } else {
    callback()
  }
}
364676
public void createImages() {
		image = UtilImageIO.loadImage(UtilIO.pathExample("standard/barbara.jpg"));

		gray = ConvertBufferedImage.convertFromSingle(image, null, GrayU8.class);
		derivX = GeneralizedImageOps.createSingleBand(GrayS16.class, gray.getWidth(), gray.getHeight());
		derivY = GeneralizedImageOps.createSingleBand(GrayS16.class, gray.getWidth(), gray.getHeight());

		GImageDerivativeOps.gradient(DerivativeType.SOBEL, gray, derivX, derivY, BorderType.EXTENDED);
	}
587150
def rk_create(self, im, im_type, timeout=60):
        
        params = {
            'typeid': im_type,
            'timeout': timeout,
        }
        params.update(self.base_params)
        files = {'image': ('check_code.png', im)}
        r = requests.post('http://api.ruokuai.com/create.json', data=params, files=files, headers=self.headers)
        return r.json()
1182945
function resize(img, width=0, height=0, type='png', quality=0.75) {
    let mime
    switch(type.toLowerCase()) {
    case 'jpg':
    case 'jpeg':
    case 'image/jpeg':
        mime = 'image/jpeg'
        break
    case 'png':
    case 'image/png':
    default:
        mime = 'image/png'
    }
    return resizePromise(img, width, height).then(
        canvas => canvas2Blob(canvas, { type: mime, quality })
        //canvas => canvas2DataUrl(canvas, { type: mime, quality })
    )
}
656695
def new_image_markup(gallery)
      render_to_string(
        file: 'bootsy/images/_new',
        formats: [:html],
        locals: { gallery: gallery, image: gallery.images.new },
        layout: false
      )
    end
578018
function( img ){
    var gl = this.gl;

    this.width  = img.width;
    this.height = img.height;

    gl.bindTexture( T2D, this.id );
    gl.texImage2D(  T2D, 0, this.internal, this.format, this.type, img );
  }
1206118
function (renderer, nodeName) {
		var markup =  ['<', nodeName, ' filled="f" stroked="f"'],
			style = ['position: ', ABSOLUTE, ';'];

		// divs and shapes need size
		if (nodeName === 'shape' || nodeName === DIV) {
			style.push('left:0;top:0;width:10px;height:10px;');
		}
		if (docMode8) {
			style.push('visibility: ', nodeName === DIV ? HIDDEN : VISIBLE);
		}

		markup.push(' style="', style.join(''), '"/>');

		// create element with default attributes and style
		if (nodeName) {
			markup = nodeName === DIV || nodeName === 'span' || nodeName === 'img' ?
				markup.join('')
				: renderer.prepVML(markup);
			this.element = createElement(markup);
		}

		this.renderer = renderer;
	}
1085774
def create_content_with_photo
      tag = params[:tag]
      photo = ContentPhoto.create

      key = tag.underscore.camelize + photo.id.to_s
      new_content = Content.create(tag: tag, key: key)

      # photo.subdomain = subdomain
      # photo.folder = current_tenant_model.whitelabel_country_code
      # photo.tenant_id = current_tenant_model.id
      if params[:file]
        photo.image = params[:file]
      end
      photo.save!
      new_content.content_photos.push photo

      # http://typeoneerror.com/labs/jsonapi-resources-ember-data/
      # resource for model
      resource = Api::V1::WebContentResource.new(new_content, nil)

      # serializer for resource
      serializer = JSONAPI::ResourceSerializer.new(Api::V1::WebContentResource)
      # jsonapi-compliant hash (ready to be send to render)

      photo.reload
      # above needed to ensure image_url is available
      # might need below if upload in prod is slow..

      # upload_confirmed = false
      # tries = 0
      # until upload_confirmed
      #   if photo.image_url.present?
      #     upload_confirmed = true
      #   else
      #     sleep 1
      #     photo.reload
      #     tries += 1
      #     if tries > 5
      #       upload_confirmed = true
      #     end
      #   end
      # end

      render json: serializer.serialize_to_hash(resource)

      # return render json: new_content.to_json
      # return render :json => { :error => "Sorry...", :status => "444", :data => "ssss" }, :status => 422
    end
827030
def create_thumbnail(img, width, height):
    
    size = (width, height)
    img.thumbnail(size)
    return img
634516
function() {
		var url = TL.Util.transformImageURL(this.data.url),
			self = this;

		// Create Dom element
		this._el.content_item	= TL.Dom.create("div", "tl-media-item tl-media-iframe", this._el.content);
		var markup = "";
		// not assigning media_id attribute. Seems like a holdover which is no longer used.
		if (TL.Browser.ie || TL.Browser.edge || url.match(/dl.dropboxusercontent.com/)) {
			markup = "<iframe class='doc' frameborder='0' width='100%' height='100%' src='//docs.google.com/viewer?url=" + url + "&amp;embedded=true'></iframe>";
		} else {
			markup = "<iframe class='doc' frameborder='0' width='100%' height='100%' src='" + url + "'></iframe>"
		}
		this._el.content_item.innerHTML	= markup
		this.onLoaded();
	}
242187
def addImg(self, img):
        '''
        
        '''
        # self.opts['imgs'].append(img)

        self.img = imread(img, 'gray', 'uint8')

        didFindCorners, corners = self.method()
        self.opts['foundPattern'].append(didFindCorners)

        if didFindCorners:
            self.findCount += 1
            self.objpoints.append(self.objp)
            self.opts['imgPoints'].append(corners)
        return didFindCorners
374316
function img_xhr(img, url) {
	var xhr = new XMLHttpRequest();
	xhr.open('GET', url, true);
	xhr.responseType = 'blob';
	xhr.onload = function(e) {
		img.src = window.URL.createObjectURL(this.response);
	};
	xhr.send();
}
304294
public function ampifyImgs() {
        $explodedContent = explode($this->imgSeparator, $this->content);
        $explodedContent = $this->reattachSeparator($explodedContent);

        $newContent = [];

        foreach ($explodedContent as $value) { // every item has one img tag except if the text did not start with an instant <img then the first is without
            
            $srcAttributeExists = preg_match("/src=.*>/", $value);
            
            if($srcAttributeExists == 1) {

                $styleAttributeExists = preg_match("/style=.*>/", $value, $style);
                
                if ($styleAttributeExists == 1) {
                    preg_match("/height:(\d*)px/", $style[0], $height);
                    preg_match("/width:(\d*)px/", $style[0], $width);
                    preg_match("/src=\"(.*?)\"/", $value, $src);
                    preg_match("/alt=\"(.*?)\"/", $value, $alt);

                    $imgHeight = $height[1];
                    $imgWidth  = $width[1];

                    $imgSrc = $src[1];

                    if(isset($alt[1])) {
                        $imgAlt = $alt[1];
                    } else {
                        $imgAlt = ""; // The img alt tag is empty
                    }

                    $ampedImgWithContent = $this->constructAmpImg($value, $imgHeight, $imgWidth, $imgSrc, $imgAlt);

                    // push back the amped content into array
                    array_push($newContent, $ampedImgWithContent);
                } else {
                    throw new \Exception('<img> tags must contain style attribute with height and width.');
                }
                    
            } else if($srcAttributeExists == 0) { // This could be the first item of an array with no img tag
                array_push($newContent, $value);
            }
            
        }
        
        // Re join the amped array items which contained img tags
        $implodedNewContent = implode("", $newContent);
        return $implodedNewContent; 
    }
73201
function() {
		try {
			var self = this;

			if (this.data.url.match("<blockquote class=['\"]imgur-embed-pub['\"]")){
				var found = this.data.url.match(/(imgur\.com)\/(\w+)/);
				this.media_id = found[2];
				this.data.url = "http://imgur.com/gallery/" + this.media_id;
			}
			else if (this.data.url){
				this.media_id = this.data.url.split('/').slice(-1)[0];
			}

	        TL.Load.js([
						'https://s.imgur.com/min/embed.js'], 
					function(){
						self.createMedia();
					}
			);

		} catch(e) {
		    this.loadErrorDisplay(this._("imgur_invalidurl_err"));
		}
	}
1143935
function (format) {
        return function (data) {
            var el = makeElement("img", [ "image-output" ]);
            el.src = "data:image/" + format + ";base64," + joinText(data).replace(/\n/g, "");
            return el;
        };
    }