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 94

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
572 $this->extension = $this->fileExtension;
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
804 width as %
810 height as %
818 width & height from aspect ratio
840 Change width & height based on dpr
852 Check values to be within domain
875 Crop, use cropped width and height as base for calulations
880 Check if there is an area to crop off
897 Check if crop is set
921 Calculate new width and height if keeping aspect-ratio.
926 Crop-to-fit and both new width and height are set.
929 Use newWidth and newHeigh as width/height, image should fit in box.
934 Both new width and height are set.
935 Use newWidth and newHeigh as max width/height, image should not be larger.
945 Use new width as max-width
952 Use new height as max-hight
959 Get image dimensions for pre-resize image.
962 Get relations of original & target image
968 Use newWidth and newHeigh as defined width/height,
969 image should fit the area.
978 Use newWidth and newHeigh as defined width/height,
979 image should fit the area.
989 Crop, ensure to set new width and height
996 Fill to fit, ensure to set new width and height
1003 No new height or width is set, use existing measures.
1444 Rotate image
1451 Auto-rotate image
1458 Scale the original image before starting
1486 Only use a specified area of the image, $this->offset is defining the area to use
1499 Do as crop, take only part of image
1509 Consider rewriting the no-upscale code to fit within this if-statement,
1510 likely to be more readable code.
1511 The code is more or leass equal in below crop-to-fit, fill-to-fit and stretch
1516 Resize by crop to fit
1553 Resize by fill to fit
1562 Check ratio for landscape or portrait
1592 Resize it
1619 $this->log("posX=$posX, posY=$posY, cropX=$cropX, cropY=$cropY.");
1649 Rotate image
1655 Apply filters
1686 Convert to palette image
1692 Blur the image
1698 Emboss the image
1704 Sharpen the image
1710 Custom convolution
1712 $this->log("Convolve: " . $this->convolve);
1791 stackoverflow.com/questions/5752514/how-to-convert-png-to-8-bit-png-using-php-gd-library
1864 Check of matching constant
1872 Expect list of 11 numbers, split by , and build up arguments
1924 Use incoming options or use $this.
1927 Treat incoming as string, split by +
1931 Check each option if it matches constant value
2121 Use JPEG optimize if defined
2143 Turn off alpha blending and set alpha flag
2148 Use external program to filter PNG, if defined
2161 Use external program to deflate PNG, if defined
2257 Get image modification time
2284 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

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";

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

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).