aws s3 file upload without imagefiled and filefield

39 views
Skip to first unread message

Parampal Singh

unread,
May 24, 2020, 12:56:24 PM5/24/20
to django...@googlegroups.com
first sorry for weak English
in code
im get image from url
save like that
#load image in skimage libray
img = io.imread(poster)
#to edit image opencv convert colors to rgb
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
#now load logo
logo = cv2.imread("static/assets/logo_o.jpg")
h_img, w_img, _ = img.shape
h_logo, w_logo, _ = logo.shape
center_y = int(h_img / 2)
center_x = int(w_img / 2)
top_y = center_y - int(h_logo / 2)
left_x = center_x - int(w_logo / 2)
bottom_y = top_y + h_logo
right_x = left_x + w_logo
roi = img[top_y: bottom_y, left_x: right_x]
# Add the Logo to the Roi
result = cv2.addWeighted(roi, 1, logo, 0.3, 0)
# Replace the ROI on the image
img[top_y: bottom_y, left_x: right_x] = result
# Get filename and save the image
cv2.imwrite(f"media/movie_poster/{save_file_name}_preview.jpg", img)



but now i try to use aws s3 how i can upload image on aws please help

Parampal Singh

unread,
May 25, 2020, 1:11:51 AM5/25/20
to Django users
please help
Reply all
Reply to author
Forward
0 new messages