@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | public static function getLeftCoord($coords, $limit = 1) |
| 41 | 41 | { |
| 42 | 42 | $c = $coords; |
| 43 | - usort($c, function (Coordinate $coordA, Coordinate $coordB) { |
|
| 43 | + usort($c, function(Coordinate $coordA, Coordinate $coordB) { |
|
| 44 | 44 | if ($coordA->getX() == $coordB->getX()) { |
| 45 | 45 | return 0; |
| 46 | 46 | } |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | public static function getTopCoord($coords, $limit = 1) |
| 60 | 60 | { |
| 61 | 61 | $c = $coords; |
| 62 | - usort($c, function (Coordinate $coordA, Coordinate $coordB) { |
|
| 62 | + usort($c, function(Coordinate $coordA, Coordinate $coordB) { |
|
| 63 | 63 | if ($coordA->getY() === $coordB->getY()) { |
| 64 | 64 | return 0; |
| 65 | 65 | } |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | public static function getRightCoord($coords, $limit = 1) |
| 79 | 79 | { |
| 80 | 80 | $c = $coords; |
| 81 | - usort($c, function (Coordinate $coordA, Coordinate $coordB) { |
|
| 81 | + usort($c, function(Coordinate $coordA, Coordinate $coordB) { |
|
| 82 | 82 | if ($coordA->getX() === $coordB->getX()) { |
| 83 | 83 | return 0; |
| 84 | 84 | } |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | public static function getBottomCoord($coords, $limit = 1) |
| 98 | 98 | { |
| 99 | 99 | $c = $coords; |
| 100 | - usort($c, function (Coordinate $coordA, Coordinate $coordB) { |
|
| 100 | + usort($c, function(Coordinate $coordA, Coordinate $coordB) { |
|
| 101 | 101 | if ($coordA->getY() === $coordB->getY()) { |
| 102 | 102 | return 0; |
| 103 | 103 | } |
@@ -60,7 +60,7 @@ |
||
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | $finalSize = 1; |
| 63 | - for ($i = 1;$i <= 1000;$i = $i + 0.5) { |
|
| 63 | + for ($i = 1; $i <= 1000; $i = $i + 0.5) { |
|
| 64 | 64 | $textbox = imageftbbox(round($this->fontToPixel($i)), 0, (string) $this->getFont(), $this->getText()); |
| 65 | 65 | |
| 66 | 66 | $height = $textbox[1] + abs($textbox[7]); |
@@ -193,8 +193,8 @@ |
||
| 193 | 193 | $latitude = $lat_direction * ($lat_degrees + ($lat_minutes / 60) + ($lat_seconds / (60 * 60))); |
| 194 | 194 | $longitude = $lon_direction * ($lon_degrees + ($lon_minutes / 60) + ($lon_seconds / (60 * 60))); |
| 195 | 195 | |
| 196 | - $latitude_deg = sprintf('%s°%s\'%s" %s', $lat_degrees, $lat_minutes, $lat_seconds, $lat_direction == 1 ? 'N':'S'); |
|
| 197 | - $longitude_deg = sprintf('%s°%s\'%s" %s', $lon_degrees, $lon_minutes, $lon_seconds, $lon_direction == 1 ? 'E':'W'); |
|
| 196 | + $latitude_deg = sprintf('%s°%s\'%s" %s', $lat_degrees, $lat_minutes, $lat_seconds, $lat_direction == 1 ? 'N' : 'S'); |
|
| 197 | + $longitude_deg = sprintf('%s°%s\'%s" %s', $lon_degrees, $lon_minutes, $lon_seconds, $lon_direction == 1 ? 'E' : 'W'); |
|
| 198 | 198 | |
| 199 | 199 | return [ |
| 200 | 200 | 'lat' => $latitude, |
@@ -31,32 +31,32 @@ |
||
| 31 | 31 | |
| 32 | 32 | $xmp_arr = []; |
| 33 | 33 | foreach ([ |
| 34 | - 'creator_email' => '<Iptc4xmpCore:CreatorContactInfo[^>]+?CiEmailWork="([^"]*)"', |
|
| 35 | - 'owner' => '<rdf:Description[^>]+?aux:OwnerName="([^"]*)"', |
|
| 36 | - 'created_at' => '<rdf:Description[^>]+?xmp:CreateDate="([^"]*)"', |
|
| 37 | - 'modified_at' => '<rdf:Description[^>]+?xmp:ModifyDate="([^"]*)"', |
|
| 38 | - 'label' => '<rdf:Description[^>]+?xmp:Label="([^"]*)"', |
|
| 39 | - 'credit' => '<rdf:Description[^>]+?photoshop:Credit="([^"]*)"', |
|
| 40 | - 'source' => '<rdf:Description[^>]+?photoshop:Source="([^"]*)"', |
|
| 41 | - 'caption_writer' => '<rdf:Description[^>]+?photoshop:CaptionWriter="([^"]*)"', |
|
| 42 | - |
|
| 43 | - 'photomechanic_prefs' => '<rdf:Description[^>]+?photomechanic:Prefs="([^"]*)"', |
|
| 44 | - 'photomechanic_pm_version' => '<rdf:Description[^>]+?photomechanic:PMVersion="([^"]*)"', |
|
| 45 | - 'photomechanic_tagged' => '<rdf:Description[^>]+?photomechanic:Tagged="([^"]*)"', |
|
| 46 | - 'photomechanic_color_class' => '<rdf:Description[^>]+?photomechanic:ColorClass="([^"]*)"', |
|
| 47 | - |
|
| 48 | - 'headline' => '<rdf:Description[^>]+?photoshop:Headline="([^"]*)"', |
|
| 49 | - 'city' => '<rdf:Description[^>]+?photoshop:City="([^"]*)"', |
|
| 50 | - 'state' => '<rdf:Description[^>]+?photoshop:State="([^"]*)"', |
|
| 51 | - 'country' => '<rdf:Description[^>]+?photoshop:Country="([^"]*)"', |
|
| 52 | - 'country_code' => '<rdf:Description[^>]+?Iptc4xmpCore:CountryCode="([^"]*)"', |
|
| 53 | - 'location' => '<rdf:Description[^>]+?Iptc4xmpCore:Location="([^"]*)"', |
|
| 54 | - 'title' => '<dc:title>\s*<rdf:Alt>\s*(.*?)\s*<\/rdf:Alt>\s*<\/dc:title>', |
|
| 55 | - 'description' => '<dc:description>\s*<rdf:Alt>\s*(.*?)\s*<\/rdf:Alt>\s*<\/dc:description>', |
|
| 56 | - 'creator' => '<dc:creator>\s*<rdf:Seq>\s*(.*?)\s*<\/rdf:Seq>\s*<\/dc:creator>', |
|
| 57 | - 'keywords' => '<dc:subject>\s*<rdf:Bag>\s*(.*?)\s*<\/rdf:Bag>\s*<\/dc:subject>', |
|
| 58 | - 'rights' => '<dc:Rights>\s*(.*?)\s*<\/dc:Rights>', |
|
| 59 | - ] as $key => $regex) { |
|
| 34 | + 'creator_email' => '<Iptc4xmpCore:CreatorContactInfo[^>]+?CiEmailWork="([^"]*)"', |
|
| 35 | + 'owner' => '<rdf:Description[^>]+?aux:OwnerName="([^"]*)"', |
|
| 36 | + 'created_at' => '<rdf:Description[^>]+?xmp:CreateDate="([^"]*)"', |
|
| 37 | + 'modified_at' => '<rdf:Description[^>]+?xmp:ModifyDate="([^"]*)"', |
|
| 38 | + 'label' => '<rdf:Description[^>]+?xmp:Label="([^"]*)"', |
|
| 39 | + 'credit' => '<rdf:Description[^>]+?photoshop:Credit="([^"]*)"', |
|
| 40 | + 'source' => '<rdf:Description[^>]+?photoshop:Source="([^"]*)"', |
|
| 41 | + 'caption_writer' => '<rdf:Description[^>]+?photoshop:CaptionWriter="([^"]*)"', |
|
| 42 | + |
|
| 43 | + 'photomechanic_prefs' => '<rdf:Description[^>]+?photomechanic:Prefs="([^"]*)"', |
|
| 44 | + 'photomechanic_pm_version' => '<rdf:Description[^>]+?photomechanic:PMVersion="([^"]*)"', |
|
| 45 | + 'photomechanic_tagged' => '<rdf:Description[^>]+?photomechanic:Tagged="([^"]*)"', |
|
| 46 | + 'photomechanic_color_class' => '<rdf:Description[^>]+?photomechanic:ColorClass="([^"]*)"', |
|
| 47 | + |
|
| 48 | + 'headline' => '<rdf:Description[^>]+?photoshop:Headline="([^"]*)"', |
|
| 49 | + 'city' => '<rdf:Description[^>]+?photoshop:City="([^"]*)"', |
|
| 50 | + 'state' => '<rdf:Description[^>]+?photoshop:State="([^"]*)"', |
|
| 51 | + 'country' => '<rdf:Description[^>]+?photoshop:Country="([^"]*)"', |
|
| 52 | + 'country_code' => '<rdf:Description[^>]+?Iptc4xmpCore:CountryCode="([^"]*)"', |
|
| 53 | + 'location' => '<rdf:Description[^>]+?Iptc4xmpCore:Location="([^"]*)"', |
|
| 54 | + 'title' => '<dc:title>\s*<rdf:Alt>\s*(.*?)\s*<\/rdf:Alt>\s*<\/dc:title>', |
|
| 55 | + 'description' => '<dc:description>\s*<rdf:Alt>\s*(.*?)\s*<\/rdf:Alt>\s*<\/dc:description>', |
|
| 56 | + 'creator' => '<dc:creator>\s*<rdf:Seq>\s*(.*?)\s*<\/rdf:Seq>\s*<\/dc:creator>', |
|
| 57 | + 'keywords' => '<dc:subject>\s*<rdf:Bag>\s*(.*?)\s*<\/rdf:Bag>\s*<\/dc:subject>', |
|
| 58 | + 'rights' => '<dc:Rights>\s*(.*?)\s*<\/dc:Rights>', |
|
| 59 | + ] as $key => $regex) { |
|
| 60 | 60 | |
| 61 | 61 | // get a single text string |
| 62 | 62 | $xmp_arr[$key] = preg_match("/$regex/is", $xmp_data, $match) ? $match[1] : ''; |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | /** @var BorderCommandOption $options */ |
| 34 | 34 | $options = $this->options; |
| 35 | 35 | |
| 36 | - for ($i = 0;$i < $options->getStroke();$i++) { |
|
| 36 | + for ($i = 0; $i < $options->getStroke(); $i++) { |
|
| 37 | 37 | $builder = new ImageBuilder($image); |
| 38 | 38 | |
| 39 | 39 | $builder->addCommand( |
@@ -34,8 +34,8 @@ |
||
| 34 | 34 | $resource = $image->getResource(); |
| 35 | 35 | |
| 36 | 36 | // start from the top-left pixel and keep looping until we have the desired effect |
| 37 | - for ($y = 0;$y < $image->getHeight();$y += $level + 1) { |
|
| 38 | - for ($x = 0;$x < $image->getWidth();$x += $level + 1) { |
|
| 37 | + for ($y = 0; $y < $image->getHeight(); $y += $level + 1) { |
|
| 38 | + for ($x = 0; $x < $image->getWidth(); $x += $level + 1) { |
|
| 39 | 39 | // get the color for current pixel |
| 40 | 40 | $rgb = imagecolorsforindex($resource, imagecolorat($resource, $x, $y)); |
| 41 | 41 | |
@@ -134,8 +134,8 @@ discard block |
||
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | $luminance = 0; |
| 137 | - for ($x = 1;$x <= $samples;$x++) { |
|
| 138 | - for ($y = 1;$y <= $samples;$y++) { |
|
| 137 | + for ($x = 1; $x <= $samples; $x++) { |
|
| 138 | + for ($y = 1; $y <= $samples; $y++) { |
|
| 139 | 139 | $coordX = round($portion->getWidth() / $samples * $x) - ($portion->getWidth() / $samples / 2); |
| 140 | 140 | $cooordY = round($portion->getHeight() / $samples * $y) - ($portion->getHeight() / $samples / 2); |
| 141 | 141 | $rgb = imagecolorat($portion->getResource(), $coordX, $cooordY); |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | * @return bool|ImageResponse |
| 206 | 206 | * @throws Exception |
| 207 | 207 | */ |
| 208 | - public function toWebP($filePathName = null){ |
|
| 208 | + public function toWebP($filePathName = null) { |
|
| 209 | 209 | return ImageWriter::toWebP($this->getResource(), $filePathName); |
| 210 | 210 | } |
| 211 | 211 | |