All pastes #820932 Raw Edit

Stuff

public text v1 · immutable
#820932 ·published 2007-12-17 20:46 UTC
rendered paste body
        function show_small($imgfile) {
                        $this->singlefile = $imgfile;
                        $src .= $this->urlvars['srcdir'] ? $this->urlvars['srcdir'].'/' :
                        '';
                        $image['linkWrap'] = $this->crlf.'<a href="'.$this->imgPath.$imgfile.'"' .' target="picturefull">|</a>'."\n";
                        $imgcode = $this->fastwrap($this->cObj->image($image));/*, $this->conf['image_wrap']);*/

                        $this->pathToSingle = preg_replace( '/^.*src\=\"/i','',$imgcode);
                        $this->pathToSingle = preg_replace( '/\".*$/','',$this->pathToSingle);


                        return $imgcode;
                }
                #/show_small

        function fastWrap($string, $wrap = '|') {
                $wraparray = explode('|', stripslashes($wrap));
                return $wraparray[0].$string.$wraparray[1];
        }
                #/fastwrap
        function getRotateParameter( $file ){
                if ($this->conf['autorotate'] == 0 )  return '';
                $exif = $this->getExifArray($file);

                //t3lib_div::debug($exif);
                $orientationvalue = null;
                foreach ($exif as $key => $value) {
                        if ( preg_match('/Orientation/' , $key) ){
                        $orientationvalue = $value;
                        break;
                        }
                }
                switch ( intval($orientationvalue) ) {
                 case 1:
                        return "";
                 case 2:
                        return "-flip horizontal";
                 case 3:
                        return "-rotate 180";
                 case 4:
                        return "-flip vertical";
                 case 5:
                        return "-transpose";
                 case 6:
                        return "-rotate 90";
                 case 7:
                        return "-transverse";
                 case 8:
                        return "-rotate 270";
                 default:
                        return "";
                 }

        }