Skip to content
This repository
Browse code

Merge pull request #1763 from dongilbert/JImage_Docs

Cleaning up formatting in JImage Docs
  • Loading branch information...
commit 9bd525c9bf47faff7250df817ede3cd7814f39eb 2 parents b7b41bb + 9a1f275
Andrew Eddie eddieajau authored

Showing 1 changed file with 19 additions and 17 deletions. Show diff stats Hide diff stats

  1. +19 17 docs/manual/en-US/chapters/packages/image.md
36 docs/manual/en-US/chapters/packages/image.md
Source Rendered
@@ -16,7 +16,6 @@ The constructor takes a single optional `$source` parameter. This argument can b
16 16 - A string containing a valid, absolute path to an image
17 17
18 18 If you choose the first option, the class sets the protected property `$handle` to the provided image resource.
19   -
20 19 If you choose the second option, the class will call the `loadFile` method, passing along the `$source` parameter.
21 20
22 21 ```php
@@ -46,10 +45,11 @@ Since Platform version 12.3, there is a new `destroy()` method that get's called
46 45
47 46 #### The `resize` method
48 47 __Accepted Parameters__
49   -* `$width`: The width of the resized image in pixels or a percentage.
50   -* `$height`: The height of the resized image in pixels or a percentage.
51   -* `$createNew`: If true the current image will be cloned, resized and returned; else the current image will be resized and returned.
52   -* `$scaleMethod`: Which method to use for scaling
  48 +
  49 +- `$width`: The width of the resized image in pixels or a percentage.
  50 +- `$height`: The height of the resized image in pixels or a percentage.
  51 +- `$createNew`: If true the current image will be cloned, resized and returned; else the current image will be resized and returned.
  52 +- `$scaleMethod`: Which method to use for scaling
53 53
54 54 Example: Using `JImage::resize()` to generate a resized image.
55 55
@@ -68,11 +68,12 @@ $image->toFile(JPATH_SITE . '/tmp/bar_resized.png');
68 68
69 69 #### The `crop` method
70 70 __Accepted Parameters__
71   -* `$width`: The width of the image section to crop in pixels or a percentage.
72   -* `$height`: The height of the image section to crop in pixels or a percentage.
73   -* `$left`: The number of pixels from the left to start cropping.
74   -* `$top`: The number of pixels from the top to start cropping.
75   -* `$createNew`: If true the current image will be cloned, cropped and returned; else the current image will be cropped and returned.
  71 +
  72 +- `$width`: The width of the image section to crop in pixels or a percentage.
  73 +- `$height`: The height of the image section to crop in pixels or a percentage.
  74 +- `$left`: The number of pixels from the left to start cropping.
  75 +- `$top`: The number of pixels from the top to start cropping.
  76 +- `$createNew`: If true the current image will be cloned, cropped and returned; else the current image will be cropped and returned.
76 77
77 78 Example: Using `JImage::crop()` to generate a cropped image.
78 79
@@ -90,9 +91,10 @@ $image->toFile(JPATH_SITE . '/tmp/bar_cropped.png');
90 91
91 92 #### The `createThumbs` method
92 93 __Accepted Parameters__
93   -* `$thumbsizes`: String or array of strings. Example: $thumbSizes = array('150x75','250x150');
94   -* `$creationMethod`: See __Resize Methods__ below.
95   -* `$thumbsFolder`: Destination for thumbnails. Passing null generates a thumbs folder in the loaded image's containing folder.
  94 +
  95 +- `$thumbsizes`: String or array of strings. Example: $thumbSizes = array('150x75','250x150');
  96 +- `$creationMethod`: See __Resize Methods__ below.
  97 +- `$thumbsFolder`: Destination for thumbnails. Passing null generates a thumbs folder in the loaded image's containing folder.
96 98
97 99 Example: Using `JImage::createThumbs()` to generate thumbnails of an image.
98 100
@@ -115,7 +117,7 @@ In this example, we use the `createThumbs` method of `JImage`. This method takes
115 117 The `resize`, `createThumbs` and `generateThumbs` methods take an optional parameter that defines what method to use when scaling an image.
116 118 This parameter can be one of the following:
117 119
118   -* `JImage::SCALE_FILL` - Gives you a thumbnail of the exact size, stretched or squished to fit the parameters.
119   -* `JImage::SCALE_INSIDE` - Fits your thumbnail within your given parameters. It will not be any taller or wider than the size passed, whichever is larger.
120   -* `JImage::SCALE_OUTSIDE` - Fits your thumbnail to the given parameters. It will be as tall or as wide as the size passed, whichever is smaller.
121   -* `JImage::CROP` - Gives you a thumbnail of the exact size, cropped from the center of the full sized image.
  120 +- `JImage::SCALE_FILL` - Gives you a thumbnail of the exact size, stretched or squished to fit the parameters.
  121 +- `JImage::SCALE_INSIDE` - Fits your thumbnail within your given parameters. It will not be any taller or wider than the size passed, whichever is larger.
  122 +- `JImage::SCALE_OUTSIDE` - Fits your thumbnail to the given parameters. It will be as tall or as wide as the size passed, whichever is smaller.
  123 +- `JImage::CROP` - Gives you a thumbnail of the exact size, cropped from the center of the full sized image.

0 comments on commit 9bd525c

Please sign in to comment.
Something went wrong with that request. Please try again.