25cef78bbd3cf3b2ba10067087831f4fd3cc03a5,mathics/builtin/image.py,ImageResize,apply_resize_width,#ImageResize#Any#Any#Any#Any#,300
Before Change
def apply_resize_width(self, image, width, evaluation, options):
"ImageResize[image_Image, width_Integer, OptionsPattern[ImageResize]]"
shape = image.pixels.shape
height = int((float(shape[0]) / float(shape[1])) * width.to_python())
return self.apply_resize_width_height(image, width, Integer(height), evaluation, options)
def apply_resize_width_height(self, image, width, height, evaluation, options):
"ImageResize[image_Image, {width_Integer, height_Integer}, OptionsPattern[ImageResize]]"
After Change
def apply_resize_width(self, image, s, evaluation, options):
"ImageResize[image_Image, s_ OptionsPattern[ImageResize]]"
old_w = image.pixels.shape[1]
if s.has_form("List", 1):
width = s.leaves[0]
else:
width = s
w = self._get_image_size_spec(old_w, width)
if w is None:
return evaluation.message("ImageResize", "imgrssz", s)
if s.has_form("List", 1):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
Project Name: mathics/Mathics
Commit Name: 25cef78bbd3cf3b2ba10067087831f4fd3cc03a5
Time: 2016-08-16
Author: 16sn6uv@gmail.com
File Name: mathics/builtin/image.py
Class Name: ImageResize
Method Name: apply_resize_width
Project Name: mathics/Mathics
Commit Name: da735616b83af99dc3a16edee3055527e379d93d
Time: 2016-08-16
Author: 16sn6uv@gmail.com
File Name: mathics/builtin/image.py
Class Name: RandomImage
Method Name: apply
Project Name: mathics/Mathics
Commit Name: 030ba1e631f2fa37b5e1a60691c310df8fee642b
Time: 2016-07-31
Author: 16sn6uv@gmail.com
File Name: mathics/builtin/arithmetic.py
Class Name: Power
Method Name: apply_check