i have written a function inside a function for getting image height and width. but when i hit url all code works except get_image_size function this is my code
class ProductDetailView(DetailView):
"""
Modified Context Data in PDP pages
"""
def get_context_data(self, **kwargs):
urlImage = 'http://'+ str(self.request.get_host()) + '/media/images/products/2016/12/dog.jpg'
print "link is",urlImage
def get_image_size(urlImage):
print "<<<<<<<<<<<<<<<<<<<<<,,"
data = requests.get(urlImage).content
im = Image.open(BytesIO(data))
return im.size
if __name__ == "__main__":
print "===========>"
width, height = get_image_size(urlImage)
print "height is--", height
print "width is --",width
what is the issue with it.
data = self.requests.get(urlImage).content.main.