code/extensions/ExtendedImage.php
public function getBase64Source(){
                $Fullpath = $this->owner->getFullPath();

                $cache = SS_Cache::factory('Base64Image');
                $cachekey = md5($Fullpath);
                if(!($Base64Image = $cache->load($cachekey))){
                    $Base64Image = base64_encode(file_get_contents($Fullpath));
                    $cache->save($Base64Image);
                }

                $type = strtolower($this->owner->getExtension());

                return "data:image/".$type.";base64,".$Base64Image;
        }
public function getBase64Source(){
                $Fullpath = $this->owner->getFullPath();

                $cache = SS_Cache::factory('Base64Image');
                $cachekey = md5($Fullpath);
                if(!($Base64Image = $cache->load($cachekey))){
                    $Base64Image = base64_encode(file_get_contents($Fullpath));
                    $cache->save($Base64Image);
                }

                $type = strtolower($this->owner->getExtension());

                return "data:image/".$type.";base64,".$Base64Image;
        }
public function getBase64Source ( ) { $ Fullpath = $ this -> owner -> getFullPath ( ) ; $ cache = SS_Cache :: factory ( 'Base64Image' ) ; $ cachekey = md5 ( $ Fullpath ) ; if ( ! ( $ Base64Image = $ cache -> load ( $ cachekey ) ) ) { $ Base64Image = base64_encode ( file_get_contents ( $ Fullpath ) ) ; $ cache -> save ( $ Base64Image ) ; } $ type = strtolower ( $ this -> owner -> getExtension ( ) ) ; return "data:image/" . $ type . ";base64," . $ Base64Image ; }
retrun the Base64 Notation of the Image
retrun the Base64 Notation of the Image