jamietre/ImageMapster — Issue #39: explicit size of image not copied in addImage
Author: kgcab
Created: 2012-01-20 23:25:52+00:00
State: open

When src and not image are set in a call to addImage, it creates a new image using the src reference.

If the original image tag has an explicit width and height set, however, this information is not applied to the copy.
This results in an image map that is one size and image which is another.

In the end, I passed a reference image to addImage, as well. If a new image is made from src and reference image is set then the reference image's width and height are applied to the copy.

It would probably be cleaner to just write an addImageCopy method which takes an image, fetches its source, creates a new image, copies the original size (and whatever else might need to be copied), then calls the original addImage with the copy.