PluginProbe
Depicter — Popup & Slider Builder / 1.9.2
Depicter — Popup & Slider Builder v1.9.2
4.8.1 trunk 1.0.0 1.1.0 1.1.2 1.1.4 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.3.5 1.3.8 1.5.0 1.5.1 1.5.2 1.5.5 1.6.0 1.6.1 1.6.2 1.7.0 All 76 releases
depicter / app / src / Media / Image / File.php

File.php in Depicter — Popup & Slider Builder 1.9.2, at app/src/Media/Image/File.php

75 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Depicter\Media\Image;
4
5
6 use Depicter\Media\File as MediaFile;
7
8 class File extends MediaFile
9 {
10
11 /**
12 * Resized width in pixels.
13 *
14 * @var int
15 */
16 protected $resized_w;
17
18 /**
19 * Resized height in pixels.
20 *
21 * @var int
22 */
23 protected $resized_h;
24
25 /**
26 * Crop width in pixels.
27 *
28 * @var int
29 */
30 protected $crop_w;
31
32 /**
33 * Crop height in pixels.
34 *
35 * @var int
36 */
37 protected $crop_h;
38
39 /**
40 * Focal points
41 *
42 * @example [50, 50] or ["center", "center"]
43 *
44 * @var array
45 */
46 protected $focal = [0.5, 0.5];
47
48 /**
49 * Set focal point
50 *
51 * @param string|float $x
52 * @param string|float $y
53 *
54 * @return $this
55 */
56 public function setFocal( $x, $y ){
57 $this->focal = [ $x, $y ];
58
59 return $this;
60 }
61
62 /**
63 * Generates a name suffix for focal point if is not default focal
64 *
65 * @return string
66 */
67 protected function focalPointSuffix(){
68 if( $this->focal[0] == 0.5 && $this->focal[0] == 0.5 ){
69 return '';
70 }
71 return round( $this->focal[0] * 1000 ) . round( $this->focal[1] * 1000 ) . '-';
72 }
73
74 }
75