[MM-63436] Replace Exif parser dependency (#30479)
* Replace Exif parser dependency * Improve forward seeking logic * Fix linting * Stop decoding upon finding tag * Use latest version of imagemeta dependency * Don't skip TIFF reader tests * Log improvements --------- Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
2454de5b4a
Коммит
f8e16780ef
@@ -60,7 +60,8 @@ func fileBytes(t *testing.T, path string) []byte {
|
||||
}
|
||||
|
||||
func testDoUploadFileRequest(t testing.TB, c *model.Client4, url string, blob []byte, contentType string,
|
||||
contentLength int64) (*model.FileUploadResponse, *model.Response, error) {
|
||||
contentLength int64,
|
||||
) (*model.FileUploadResponse, *model.Response, error) {
|
||||
req, err := http.NewRequest("POST", c.APIURL+"/files"+url, bytes.NewReader(blob))
|
||||
require.NoError(t, err)
|
||||
|
||||
@@ -390,6 +391,19 @@ func TestUploadFiles(t *testing.T) {
|
||||
expectedImageMiniPreview: []bool{true},
|
||||
expectedCreatorId: th.BasicUser.Id,
|
||||
},
|
||||
// 5MB+ JPEG
|
||||
{
|
||||
title: "Happy image thumbnail/preview 5MB+",
|
||||
names: []string{"orientation_test_9.jpeg"},
|
||||
expectedImageThumbnailNames: []string{"orientation_test_9_expected_thumb.jpeg"},
|
||||
expectedImagePreviewNames: []string{"orientation_test_9_expected_preview.jpeg"},
|
||||
expectImage: true,
|
||||
expectedImageWidths: []int{4000},
|
||||
expectedImageHeights: []int{2667},
|
||||
expectedImageHasPreview: []bool{true},
|
||||
expectedImageMiniPreview: []bool{true},
|
||||
expectedCreatorId: th.BasicUser.Id,
|
||||
},
|
||||
// TIFF preview test
|
||||
{
|
||||
title: "Happy image thumbnail/preview 9",
|
||||
|
||||
@@ -1664,7 +1664,6 @@ func getTeamIcon(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
team, err := c.App.GetTeam(c.Params.TeamId)
|
||||
|
||||
if err != nil {
|
||||
c.Err = err
|
||||
return
|
||||
@@ -1742,7 +1741,7 @@ func setTeamIcon(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
imageData := imageArray[0]
|
||||
|
||||
if err := c.App.SetTeamIcon(c.Params.TeamId, imageData); err != nil {
|
||||
if err := c.App.SetTeamIcon(c.AppContext, c.Params.TeamId, imageData); err != nil {
|
||||
c.Err = err
|
||||
return
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user