This simple patch adds support for selecting the original image size
in img_assist.module,v 1.56.2.6, line 772 add:
// add a choice for 'original' if it's under the maximum size
if (($properties_size['width'] <= $max_size[0]) && ($properties_size['height'] <= $max_size[1])) {
$derivatives[$properties_size['width'] . 'x' . $properties_size['height']] = t('original');
}
This possibly needs to also check if a user is allowed to set 'custom' sizes, but I figured that the original size (provided it's less than the max) is safe.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | img_assist.module_6.patch | 1.08 KB | RobRoy |
| #1 | img_assist.module_5.patch | 757 bytes | RobRoy |
Comments
Comment #1
RobRoy commentedHere is a proper patch. I've tested it and it works great. This really helps with a TinyMCE bug when the image you're uploading is smaller than the 'preview' size, it will still show up in TinyMCE as super big when it is really smaller. Good stuff gregmac.
Comment #2
RobRoy commentedSpoke too soon. I just noticed when uploading a big image, clicking the original setting results in a preview sized image. Looks like I fixed it, but will wait for reviews.
Comment #3
adrianmak commentedI used RobRoy patch and still got problem.
When I upload image e.g. 4.jpg thru img_assist, it will create 4 files
4.img_assist_properties.jpg
4.jpg
4.preview.jpg
4.thumbnail.jpg
Then I select original size and insert into my page node, the inserted code shown me that
Why the size is 116x 200 and it's not the image original size ? ( After inserted the image, it will create a image called 4.img_assist_custom.jpg)
Comment #4
RobRoy commentedDid you use the last patch I posted? And do anonymous users have the 'view original images' permission enabled?
Comment #5
hyperlogos commentedHere's how I fixed this
and
That pretty much covers it. Note that my patch also provides an additional permission to allow the use of the original size, and includes two new alignment options: center, and none. (I'm trying to roll all the functionality I want added into a single, working patch - but honestly they could be separate, it just complicates the context diffs because you need more context.
Comment #6
darren ohDuplicate of issue 89076.