recover the width and height
move interaction_graphic -> picture.
496672
private function checkInteractionGraphic()
    {
        $this->log('Checking InteractionGraphic ...');

        $checkQuery = '
            SELECT id, document_id, width, height
            FROM ujm_interaction_graphic
        ';

        $results = $this->connection->query($checkQuery)->fetchAll();
        foreach ($results as $res) {
            $this->connection->exec("
                UPDATE ujm_picture_temp
                SET width = {$res['width']}, height = {$res['height']}
                WHERE id = {$res['id']}
            ");
        }

        $this->connection->exec('
            UPDATE ujm_interaction_graphic
            SET document_id = NULL
        ');
    }
757810
function glk_image_get_info(imgid, widthref, heightref) {
    if (!GiLoad || !GiLoad.get_image_info)
        return null;

    var info = GiLoad.get_image_info(imgid);
    if (info) {
        if (widthref)
            widthref.set_value(info.width);
        if (heightref)
            heightref.set_value(info.height);
        return 1;
    }
    if (widthref)
        widthref.set_value(0);
    if (heightref)
        heightref.set_value(0);
    return 0;
}
177476
def calculate_dimensions(image, long_side, short_side):
    """"""
    if image.width >= image.height:
        return '{0}x{1}'.format(long_side, short_side)
    return '{0}x{1}'.format(short_side, long_side)
459308
def display(self, image):
        
        assert(image.mode == self.mode)
        assert(image.size == self.size)

        image = self.preprocess(image)

        if self.framebuffer.redraw_required(image):
            left, top, right, bottom = self._apply_offsets(self.framebuffer.bounding_box)
            width = right - left
            height = bottom - top

            self._set_position(top, right, bottom, left)

            i = 0
            buf = bytearray(width * height * 2)
            for r, g, b in self.framebuffer.getdata():
                if not(r == g == b == 0):
                    # 65K format 1
                    buf[i] = r & 0xF8 | g >> 5
                    buf[i + 1] = g << 3 & 0xE0 | b >> 3
                i += 2

            self.data(list(buf))
331500
def image_resolution(self) -> Optional[Tuple[int, int]]:
        

        """
        images = self.attributes.get('imageinfo', [])
        if images and isinstance(images, collections.abc.Sequence):
            img = images[0]
            return img['width'], img['height']
        return None
684192
def _get_image_size(self, maxcharno, maxlineno):
        
        return (self._get_char_x(maxcharno) + self.image_pad,
                self._get_line_y(maxlineno + 0) + self.image_pad)
1231927
def get_image(dataset):
    """"""
    dim, nrow, ncol = dataset.shape
    uint8_dataset = dataset.astype('uint8')
    if not (uint8_dataset == dataset).all():
        message = (
            "\nYour image was cast to a `uint8` (`<img>.astype(uint8)`), "
            "but some information was lost.\nPlease check your gif and "
            "convert to uint8 beforehand if the gif looks wrong."
        )
        warnings.warn(message)
    image = [[
            struct.pack(
                'BBB',
                uint8_dataset[0, i, j],
                uint8_dataset[1, i, j],
                uint8_dataset[2, i, j]
            )
            for j in range(ncol)]
        for i in range(nrow)]
    return image
172180
def image_shape(img):
    ''''''
    if hasattr(img, 'shape'):
        return (img.shape[1], img.shape[0])
    return (img.width, img.height)
455965
def _get_scaled_image(self, resource):
        
        image = self._get_image()
        original_width, original_height = resource.size

        k = image.size[0] / float(image.size[1])

        if image.size[0] >= image.size[1]:
            target_width = int(original_width * self.size)
            target_height = int(target_width / k)
        else:
            target_height = int(original_height * self.size)
            target_width = int(target_height * k)

        image = image.resize((target_width, target_height), Image.ANTIALIAS)

        return image
17879
def inspect_figure(fig):
        """"""
        return fig.number, {
            'num': fig.number,
            'figsize': (fig.get_figwidth(), fig.get_figheight()),
            'dpi': fig.get_dpi() / getattr(fig.canvas, '_dpi_ratio', 1),
            'facecolor': fig.get_facecolor(),
            'edgecolor': fig.get_edgecolor(),
            'frameon': fig.get_frameon(),
            'tight_layout': fig.get_tight_layout(),
            'subplotpars': vars(fig.subplotpars)}
386556
function (x, y) {
        var i = (y * this.size.w + x) * this.bytes;
        var res = [this.image[i], this.image[i + 1], this.image[i + 2], this.image[i + 3]];
        return res;
    }
422103
def function(self,p):
        """"""
        int_index=int(len(p.generators)*wrap(0,1.0,p.index))
        pg=p.generators[int_index]

        image_array = pg(xdensity=p.xdensity,ydensity=p.ydensity,bounds=p.bounds,
                         x=p.x+p.size*(pg.x*np.cos(p.orientation)-pg.y*np.sin(p.orientation)),
                         y=p.y+p.size*(pg.x*np.sin(p.orientation)+pg.y*np.cos(p.orientation)),
                         orientation=pg.orientation+p.orientation,size=pg.size*p.size,
                         scale=pg.scale*p.scale,offset=pg.offset+p.offset)

        return image_array
66839
def _getImageSize(filename):
    """"""
    result = None
    file = open(filename, 'rb')
    if file.read(8) == b'\x89PNG\r\n\x1a\n': # PNG
        while 1:
            length, = _struct.unpack('>i', file.read(4))
            chunkID = file.read(4)
            if chunkID == '': # EOF
                break
            if chunkID == b'IHDR':
                # return width, height
                result = _struct.unpack('>ii', file.read(8))
                break
            file.seek(4 + length, 1)
        file.close()
        return result
    file.seek(0)
    if file.read(8) == b'BM': # Bitmap
        file.seek(18, 0) # skip to size data
        result = _struct.unpack('<ii', file.read(8))
    file.close()
    return result
831936
def _pic(self):
        """"""
        return CT_Picture.new_video_pic(
            self._shape_id, self._shape_name, self._video_rId,
            self._media_rId, self._poster_frame_rId, self._x, self._y,
            self._cx, self._cy
        )
629070
def resize(self, width=None):
        
        (iw, ih) = self.size
        if width is None:
            width = min(iw, utils.term.width)
        elif isinstance(width, basestring):
            percents = dict([(pct, '%s%%' % (pct)) for pct in range(101)])
            width = percents[width]
        height = int(float(ih) * (float(width) / float(iw)))
        height //= 2
        self.img = self.img.resize((width, height))
641566
def get_image(self, cat, img):
        
        filename = self.path(cat, img)
        data = []
        if filename.endswith('mat'):
            data = loadmat(filename)['output']
        else:
            data = imread(filename)
        if self.size is not None:
            return imresize(data, self.size)
        else:
            return data
401879
def scale_to(self, width_height=Vector2()):
        """"""
        scale_amt = Vector2()
        scale_amt.X = float(width_height.X) / self.image.get_width()
        scale_amt.Y = float(width_height.Y) / self.image.get_height()
        self.set_scale(scale_amt)