文档中心 > 图像处理
图像处理

最近更新时间:2022-07-25

被处理图片是存放对象存储桶内的存储对象。

使用桶域名拼接链接可直接请求。


缩放处理请求

from src.ossConfig import ossConfig

import Oss as Oss

access_key = 'youraccesskey'
secret_key = 'yoursecretkey'
endpoint_url = 'http://XXXXXXXXXXXXXXXXX.com'
config = ossConfig(access_key,secret_key,endpoint_url)

bucket_name = 'test1'
object_name = "testfile"
path = "./path"
style = "x-oss-process=image/resize,m_fixed,w_100,h_100"

Oss.Image_processing(config,bucket_name,object_name,path,style)


旋转处理请求

from src.ossConfig import ossConfig

import Oss as Oss

access_key = 'youraccesskey'
secret_key = 'yoursecretkey'
endpoint_url = 'http://XXXXXXXXXXXXXXXXX.com'
config = ossConfig(access_key,secret_key,endpoint_url)

bucket_name = 'test1'
object_name = "testfile"
path = "./path"
style = "x-oss-process=image/rotate,90"

Oss.Image_processing(config,bucket_name,object_name,path,style)


文字水印处理请求

from src.ossConfig import ossConfig

import Oss as Oss

access_key = 'youraccesskey'
secret_key = 'yoursecretkey'
endpoint_url = 'http://XXXXXXXXXXXXXXXXX.com'
config = ossConfig(access_key,secret_key,endpoint_url)

bucket_name = 'test1'
object_name = "testfile"
path = "./path"
style = "x-oss-process=image/watermark,text_SGVsbG8g5Zu-54mH5pyN5YqhIQ,x_0,y_0"

Oss.Image_processing(config,bucket_name,object_name,path,style)