-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
Description
What Happened
When uploading images to Slack using the files.remote.update
API, the image quality noticeably deteriorates. This reduction in quality is not observed when using other Slack file upload APIs like files.upload
.
Is there any configuration or setting we can modify to preserve image quality during remote uploads?
Expected Behavior
Uploaded images should maintain their original quality, including resolution and sharpness.
Steps to Reproduce
- Use the
files.upload
API from Slack's messaging documentation (API link) to upload an image and observe the quality. - Use
files.remote.update
API to update an image with the parameters provided below. - Compare the image quality.
Reproducible Code
uploads := slack.UploadFileV2Parameters{
Filetype: "auto",
Filename: "Loading...",
FileSize: int(fileSize),
Reader: fileBuffer,
Channels: []string{n.BotEvent.ChannelID},
Channel: n.BotEvent.ChannelID,
ThreadTimestamp: n.BotEvent.ThreadTimeStamp,
Title: appMentionTmpl.Title,
//InitialComment: appMentionTmpl.InitialComment,
}
uploadResp, er := n.Messenger.CompleteUploadExternal(ctx, uploads)
payload := slack.RemoteFileParameters{
ExternalID: s.uuidGenerator.New(),
Title: fmt.Sprintf("Model: %s", n.Data[ThreadWorksheetName]),
// PreviewImage: text,
PreviewImageReader: nlsObject.Reader,
}
_, err = n.Messenger.UpdateRemoteFile(ctx, fileID, payload)
if err != nil {
return fmt.Errorf("failed to update remote file: %w", err)
}
Versions
- Go: v1.22.6
- slack-go/slack:v0.14.0