webroot/img.php 25

Type Line Description
6 dbwebb.se/opensource/cimage
7 github.com/mosbth/cimage
158 Settings for any mode
166 Specific settings for each mode
217 Check if passwords match, if configured to use passwords
249 Always allow when password match
255 Allow when serverName matches refererHost
346 Check for valid/invalid characters
356 If source is a remote file, ignore local file checks.
360 Check that the image is a file below the directory 'image_path'.
387 Set sizes to map constant to value, easier to use with width or height
393 Add grid column width, useful for use as predefined size for width (or height).
415 Check to replace predefined size
420 Support width as % of original width
440 Check to replace predefined size
445 height
475 Check to replace predefined aspect ratio
750 php.net/manual/en/function.imageconvolution.php
755 Check if the convolve is matching an existing constant
835 code.jquery.com/jquery-2.1.1.min.js"></script>
866 Options for calculate dimensions
877 Pre-processing, before resizing is done
882 General processing options
885 Post-processing, after resizing is done
894 Output format

CRemoteImage.php 5

Type Line Description
227 Save only if body is a valid image
279 First check if the cache is valid and can be used
290 Do a HTTP request to download item
336 Is cache valid?
344 Prepare for a 304 if available

CImage.php 93

Type Line Description
6 dbwebb.se/opensource/cimage
7 github.com/mosbth/cimage
86 private $bgColorDefault = self::BACKGROUND_COLOR;
215 Calculated from source image
216 Calculated from source image
223 Save original value
225 Save original value
246 Save original value
310 private $remotePattern = '#^[http|https]://#';
311 #';
335 Calculated from source image
336 Calculated from source image
337 Use original image if possible
603 Sanitize filename
624 Options for calculate dimensions
631 array('width'=>null, 'height'=>null, 'start_x'=>0, 'start_y'=>0),
632 '0,0,0,0',
635 Options for caching or using original
639 Pre-processing, before resizing is done
644 General options
647 Post-processing, after resizing is done
656 Output format
660 Options for saving
661 'quality' => null,
662 'compress' => null,
663 'saveAs' => null,
666 Convert crop settings from string to array
677 Convert area settings from string to array
688 Convert filter settings from array of string to array of array
700 php.net/manual/en/function.imagefilter.php'
708 Merge default arguments with incoming and set properties.
709 $args = array_merge_recursive($defaults, $args);
719 Save original values to enable re-calculating
778 Get details on image
805 width as %
811 height as %
819 width & height from aspect ratio
841 Change width & height based on dpr
853 Check values to be within domain
876 Crop, use cropped width and height as base for calulations
881 Check if there is an area to crop off
898 Check if crop is set
922 Calculate new width and height if keeping aspect-ratio.
927 Crop-to-fit and both new width and height are set.
930 Use newWidth and newHeigh as width/height, image should fit in box.
935 Both new width and height are set.
936 Use newWidth and newHeigh as max width/height, image should not be larger.
946 Use new width as max-width
953 Use new height as max-hight
960 Get image dimensions for pre-resize image.
963 Get relations of original & target image
969 Use newWidth and newHeigh as defined width/height,
970 image should fit the area.
979 Use newWidth and newHeigh as defined width/height,
980 image should fit the area.
990 Crop, ensure to set new width and height
997 Fill to fit, ensure to set new width and height
1004 No new height or width is set, use existing measures.
1417 Rotate image
1424 Auto-rotate image
1431 Scale the original image before starting
1459 Only use a specified area of the image, $this->offset is defining the area to use
1472 Do as crop, take only part of image
1482 Consider rewriting the no-upscale code to fit within this if-statement,
1483 likely to be more readable code.
1484 The code is more or leass equal in below crop-to-fit, fill-to-fit and stretch
1489 Resize by crop to fit
1526 Resize by fill to fit
1535 Check ratio for landscape or portrait
1565 Resize it
1592 $this->log("posX=$posX, posY=$posY, cropX=$cropX, cropY=$cropY.");
1622 Rotate image
1628 Apply filters
1659 Convert to palette image
1665 Blur the image
1671 Emboss the image
1677 Sharpen the image
1683 Custom convolution
1685 $this->log("Convolve: " . $this->convolve);
1764 stackoverflow.com/questions/5752514/how-to-convert-png-to-8-bit-png-using-php-gd-library
1837 Check of matching constant
1845 Expect list of 11 numbers, split by , and build up arguments
1897 Use incoming options or use $this.
1900 Treat incoming as string, split by +
1904 Check each option if it matches constant value
2110 Use JPEG optimize if defined
2133 Turn off alpha blending and set alpha flag
2138 Use external program to filter PNG, if defined
2151 Use external program to deflate PNG, if defined
2244 Get image modification time
2271 Get details on image
TODO 383 clean up how $this->saveFolder is used in other methods.
TODO 328 Clean up these and check if and how they are used

webroot/img_config.php 36

Type Line Description
17 'mode' => 'production', // 'development', 'strict'
25 used from v0.6.2
26 used until v0.6.1
29 'cimage_class' => __DIR__ . '/../CImage.php',
44 'alias_path' => __DIR__ . '/img/alias/',
55 as in do not use password
56 do not always require password,
58 'password' => false, // "secret-password",
59 'password_always' => false, // always require password,
77 use default values from CImage which is to
78 allow download from any http- and
79 https-source.
80 use default values from CImage which is to
81 allow download from any hosts.
83 'remote_allow' => true,
84 'remote_pattern' => '#^https?://#',
85 'remote_whitelist' => array(
86 '\.facebook\.com$',
87 '^(?:images|photos-[a-z])\.ak\.instagram\.com$',
88 '\.google\.com$'
89 ),
100 'valid_filename' => '#^[a-z0-9A-Z-/_\.:]+$#',
101 'valid_aliasname' => '#^[a-z0-9A-Z-_]+$#',
113 'image_path_constraint' => false,
123 'default_timezone' => 'UTC',
136 'max_width' => 2000,
137 'max_height' => 2000,
152 'background_color' => "FFFFFF",
153 'background_color' => "FFFFFF7F",
196 'sharpen' => '-1,-1,-1, -1,16,-1, -1,-1,-1, 8, 0',
197 'sharpen-alt' => '0,-1,0, -1,5,-1, 0,-1,0, 1, 0',
247 results in width=613
248 results in spanning two columns with a gutter, 30*2+10=70
249 results in spanning whole grid 24*30+((24-1)*10)=950
257 Set sizes to map constant to value, easier to use with width or height
263 Add grid column width, useful for use as predefined size for width (or height).

CHttpGet.php 1

Type Line Description
211 max-age=2592000

autoload.php 4

Type Line Description
6 include __DIR__ . "/../CHttpGet.php";
7 include __DIR__ . "/../CRemoteImage.php";
8 include __DIR__ . "/../CImage.php";
18 $path = CIMAGE_SOURCE_PATH . "/{$class}.php";