Função de processamento de dados de GPS de EXIF de imagem
@return null
174875
public function getGPSExifInfo()
    {
        $lat = $this->exif['GPS']['GPSLatitude'];
        $log = $this->exif['GPS']['GPSLongitude'];
        if (empty($lat) or empty($log)) {
            return null;
        }

        // latitude values //
        list($num_degrees_lat, $dec_degrees_lat) = explode('/', $lat[0]);
        $lat_degrees = $num_degrees_lat / $dec_degrees_lat;
        list($num_minutes_lat, $dec_minutes_lat) = explode('/', $lat[1]);
        $lat_minutes = $num_minutes_lat / $dec_minutes_lat;
        list($num_seconds_lat, $dec_seconds_lat) = explode('/', $lat[2]);
        $lat_seconds = $num_seconds_lat / $dec_seconds_lat;

        $lat_hemi = $this->exif['GPS']['GPSLatitudeRef'];

        // longitude values //
        list($num_degrees_log, $dec_degrees_log) = explode('/', $log[0]);
        $log_degrees = $num_degrees_log / $dec_degrees_log;
        list($num_minutes_log, $dec_minutes_log) = explode('/', $log[1]);
        $log_minutes = $num_minutes_log / $dec_minutes_log;
        list($num_seconds_log, $dec_seconds_log) = explode('/', $log[2]);
        $log_seconds = $num_seconds_log / $dec_seconds_log;

        $log_hemi = $this->exif['GPS']['GPSLongitudeRef'];

        // latitude formatter with hemisfere
        $dLat = $lat_degrees + $lat_minutes / 60 + $lat_seconds / 3600;
        $lat_decimal = ($lat_hemi == 'S' || $lat_hemi == 'W') ? $dLat*=-1 : $dLat;

        // longitude formatter with hemisfere
        $dLog = $log_degrees + $log_minutes / 60 + $log_seconds / 3600;
        $log_decimal = ($log_hemi == 'S' || $log_hemi == 'W') ? $dLog*=-1 : $dLog;

        return array('lt' => $lat_decimal, 'lg' => $log_decimal);
    }
324525
private function call() {

        if(null === $this -> driver) {
            return trigger_error('Driver is not set. Set the driver with the setDriver() method', E_USER_ERROR);
        }

        if(null === $this -> image) {
        	return trigger_error('Image has not been set. Set the image with the setImage() method', E_USER_ERROR);
        }

        if(null === $this -> driverInstance) {
        	$this -> driverInstance = new $this -> driver($this -> image);
        }

        return $this -> driverInstance;
    }
1202265
function processImage()
    {
        $destinationImageObject = $this->imageObjectInternal();
        $bbox = $this->textBoundingBox();
        $this->clear();
        $font = $this->font();
        $this->drawText( $font, $this->textColor(), $this->text(), $bbox[6], -$bbox[7], $this->textAngle(),
                         $destinationImageObject );
        return true;
    }
466023
function load()
    {
        if ( $this->ImageObject !== null and
             $this->ImageObjectRef !== null )
            return;
        switch( $this->StoredType )
        {
            case 'png':
            {
                return $this->loadPNG( $this->StoredPath, $this->StoredFile );
            } break;

            case 'jpg':
            {
                return $this->loadJPEG( $this->StoredPath, $this->StoredFile );
            } break;

            case 'gif':
            {
                return $this->loadGIF( $this->StoredPath, $this->StoredFile );
            } break;

            default:
            {
                if ( @$this->loadPNG( $this->StoredPath, $this->StoredFile ) )
                    return true;
                else if ( @$this->loadJPEG( $this->StoredPath, $this->StoredFile ) )
                    return true;
                else if ( @$this->loadGIF( $this->StoredPath, $this->StoredFile ) )
                    return true;
                eZDebug::writeError( 'Image format not supported: ' . $this->StoredType, __METHOD__ );
            }
        }
        return false;
    }
762242
public function isImage() {
		try {
			if (!function_exists('exif_imagetype') && !function_exists('Jodit\exif_imagetype')) {
				function exif_imagetype($filename) {
					if ((list(, , $type) = getimagesize($filename)) !== false) {
						return $type;
					}

					return false;
				}
			}

			return in_array(exif_imagetype($this->getPath()), [IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG, IMAGETYPE_BMP]);
		} catch (\Exception $e) {
			return false;
		}
	}
1017644
function( isUndo )
		{
			var snapshots = this.snapshots,
				currentImage = this.currentImage,
				image, i;

			if ( currentImage )
			{
				if ( isUndo )
				{
					for ( i = this.index - 1 ; i >= 0 ; i-- )
					{
						image = snapshots[ i ];
						if ( !currentImage.equals( image, true ) )
						{
							image.index = i;
							return image;
						}
					}
				}
				else
				{
					for ( i = this.index + 1 ; i < snapshots.length ; i++ )
					{
						image = snapshots[ i ];
						if ( !currentImage.equals( image, true ) )
						{
							image.index = i;
							return image;
						}
					}
				}
			}

			return null;
		}
506331
public function parseImageInfo() 
    {
    	if (null === $this->sourceImagePath) {
    		throw new NoSourceException();
    	}
    	
    	$pathinfo = pathinfo($this->sourceImagePath);
    	if (!is_array($pathinfo)) {
    		throw new \RuntimeException("It is not possible to correctly get pathinfo for the image file '" . $this->sourceImagePath . "' ");
    	}
        
        $imagesize = getimagesize($this->sourceImagePath);
        if (!is_array($imagesize)) {
            throw new \RuntimeException("It is not possible to correctly get imagesize for the image file '" . $this->sourceImagePath . "' ");
        }
    	
    	$info = $pathinfo + $imagesize;
        
        if (isset($info[0])) {
            $info['width'] = $info[0];
        } else {
            throw new \RuntimeException("Unable to get width for the image file '" . $this->sourceImagePath . "' ");
        }
        
        if (isset($info[1])) {
            $info['height'] = $info[1];
        } else {
            throw new \RuntimeException("Unable to get height for the image file '" . $this->sourceImagePath . "' ");
        }
        
        if (!isset($info['mime'])) {
            throw new \RuntimeException("Unable to get mimetype for the image file '" . $this->sourceImagePath . "' ");
        }

        unset($info[0], $info[1], $info[2], $info[3]);
        
        switch(strtolower($info['mime'])) {
		case 'image/png':
			$info['extension'] = 'png';
            break;
            
		case 'image/jpeg':
			$info['extension'] = 'jpg';
            break;
            
		case 'image/gif':
			$info['extension'] = 'gif';
            break;
            
		default:
			throw new \RuntimeException("Unable to get extension for the image file '" . $this->sourceImagePath . "' ");
            break;
        }
    	
        // We set the default width/height values for the destination image if resize is not called
        $this->destImageWidth = $info['width'];
        $this->destImageHeight = $info['height'];
        
        $this->setExtension($info['extension']);
        $this->imageInfo = $info;
        
    	return $this;
    }
457496
public function getInfo()
    {

        $file_info = @getimagesize($this->path);

        //define the original width of the image
        $this->width['orig'] = $file_info['0'];

        //define the original height of the image
        $this->height['orig'] = $file_info['1'];

        //image type //1 = GIF, 2 = JPG, 3 = PNG, 4 = SWF, 5 = PSD, 6 = BMP, 7 = TIFF(intel byte order), 8 = TIFF(motorola byte order), 9 = JPC, 10 = JP2, 11 = JPX, 12 = JB2, 13 = SWC, 14 = IFF, 15 = WBMP, 16 = XBM

        switch ($file_info[2])

    {
            case "1":
                $this->type = "gif";
            break;

            case "2":
                $this->type = "jpg";
            break;

            case "3":
                $this->type = "png";
            break;
        }
        //////////////////////////
        $this->original = imagecreatefromstring(file_get_contents($this->path));

    }
796103
public static function getImageConvertExecutable()
    {
        if ( !is_null( self::$imageConvert ) )
        {
            return self::$imageConvert;
        }
        return ( self::$imageConvert = self::findExecutableInPath( 'convert' ) );
    }
562407
public function getExif()
    {
        $sections_count = count($this->sections);
        for ($i = 0; $i < $sections_count; $i ++) {
            $section = $this->getSection(PelJpegMarker::APP1, $i);
            if ($section instanceof PelExif) {
                return $section;
            }
        }
        return null;
    }
256261
protected function leadSWF()
	{
		$exif  = exif_imagetype($this->file);
		$flash = ($exif === IMAGETYPE_SWF || $exif === IMAGETYPE_SWC);

		if ($exif)
		{
			return $this->closeCase("swf", "application/x-shockwave-flash");
		}

		return null;
	}
405018
public function getImageBackend()
    {
        // Re-use existing image backend if set
        if ($this->imageBackend) {
            return $this->imageBackend;
        }

        // Skip files we know won't be an image
        if (!$this->getIsImage() || !$this->getHash()) {
            return null;
        }

        // Pass to backend service factory
        try {
            return $this->imageBackend = Injector::inst()->createWithArgs(Image_Backend::class, array($this));
        } catch (InjectorNotFoundException $ex) {
            // Handle file-not-found errors
            return null;
        }
    }
119907
public function getAvatarImage(): ?ImageMedium
    {
        $avatars = $this->get('avatar');
        if (\is_array($avatars) && $avatars) {
            $avatar = array_shift($avatars);

            $media = $this->getMedia();
            $name = $avatar['name'] ?? null;

            $image = $name ? $media[$name] : null;
            if ($image instanceof ImageMedium) {
                return $image;
            }
        }

        return null;
    }
859421
protected function getImageMime($tmp_name)
    {
      $this->mime = @$this->acceptedMimes[exif_imagetype($tmp_name)];
      if (!$this->mime) {
        return null;
      }

      return $this->mime;
    }
885034
protected function resolveMetaImage($img = null)
    {
        if (!$img) {
            $img = static::DEFAULT_SOCIAL_MEDIA_IMAGE;
        }

        if ($img) {
            $uri = $this->baseUrl();
            return $uri->withPath(strval($img));
        }

        return null;
    }
1345774
public function start()
    {
        $one_pixel_image = 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD//gATQ3JlYXRlZCB3aXRoIEdJTVD/2wBDAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQoHBwYIDAoMDAsKCwsNDhIQDQ4RDgsLEBYQERMUFRUVDA8XGBYUGBIUFRT/2wBDAQMEBAUEBQkFBQkUDQsNFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBT/wgARCAABAAEDAREAAhEBAxEB/8QAFAABAAAAAAAAAAAAAAAAAAAACP/EABQBAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhADEAAAAVSf/8QAFBABAAAAAAAAAAAAAAAAAAAAAP/aAAgBAQABBQJ//8QAFBEBAAAAAAAAAAAAAAAAAAAAAP/aAAgBAwEBPwF//8QAFBEBAAAAAAAAAAAAAAAAAAAAAP/aAAgBAgEBPwF//8QAFBABAAAAAAAAAAAAAAAAAAAAAP/aAAgBAQAGPwJ//8QAFBABAAAAAAAAAAAAAAAAAAAAAP/aAAgBAQABPyF//9oADAMBAAIAAwAAABCf/8QAFBEBAAAAAAAAAAAAAAAAAAAAAP/aAAgBAwEBPxB//8QAFBEBAAAAAAAAAAAAAAAAAAAAAP/aAAgBAgEBPxB//8QAFBABAAAAAAAAAAAAAAAAAAAAAP/aAAgBAQABPxB//9k=';

        $array = [
            $this->request->get('msg'),
            'File: ' . $this->request->get('file'),
            'Line: ' . $this->request->get('line'),
            'Col: ' . $this->request->get('col'),
            'Err: ' . $this->request->get('err'),
        ];

        $log = LoggerFactory::create('JSErr');

        $log->error(implode(' | ', $array));

        echo $one_pixel_image;
    }
217986
public function offsetGet($offset)
    {
        return isset($this->images[$offset]) ? $this->images[$offset] : null;
    }