Commit Graph

56 Commits

Author SHA1 Message Date
Andrea Maria Piana 1c660c3525 Move images to shared namespace 2023-02-02 19:18:06 +00:00
Pascal Precht 2cac37c1fb fix(images): ensure decode from URL emits error on HTTP error code
We should emit an error when the request to an image to be fetched
returns and HTTP error code. Otherwise, we'll run into other higher
level errors down the line, which are misleading

Example: I kept seeing "image content type not supported" errors,
although the content type *is* supported. The actual problem was that
the decode function operates on non existing image bytes.
2022-09-19 12:55:17 +02:00
frank 6e4ac1c495 Use image server for all kind of images and integrate identity rings 2022-09-16 09:52:08 +01:00
frank 325efd01d0 Implement identity ring 2022-09-16 09:52:08 +01:00
Samuel Hawksby-Robinson 41cb9d7bea Added httptest.NewServer to DecodeFromURL and CryptoOnRamp tests 2022-09-09 15:07:48 +01:00
Samuel Hawksby-Robinson 399090a44b Added fix for pinging a remote service in tests 2022-09-09 15:07:48 +01:00
Samuel Hawksby-Robinson cea3b3db0d Added FileSizeError instead of clunky awful string comparison 2022-09-05 16:06:04 +01:00
Samuel Hawksby-Robinson 45b287370a Implemented more comprehensive file compression to handle large files 2022-09-05 16:06:04 +01:00
Michal Iskierko e3f451cd79 feat: Handle image in group chat
Add image_payload column to chats table.
Add Base64Image to chat struct.
Add ImageChange event to propagate image.
Change EditChat API - use CroppedImage.
Process and crop image in EditGroupChat.
2022-09-01 12:19:01 +02:00
Samuel Hawksby-Robinson 344272ee08 Moved protobuf marshalling closer to the structs that get marshalled 2022-08-22 13:27:59 +01:00
Samuel Hawksby-Robinson 06f4b85792 undoing the rookie things I did 2022-08-22 13:27:59 +01:00
Samuel Hawksby-Robinson 344458d74a Added multiaccounts.Database tests for new funcs 2022-08-22 13:27:59 +01:00
Samuel Hawksby-Robinson 38c8e8a1fe Added payload marshal and unmarshal to/from protobuf 2022-08-22 13:27:59 +01:00
Jakub Sokołowski 530f3c7a3a
rename status-react to status-mobile
Signed-off-by: Jakub Sokołowski <jakub@status.im>
2022-07-17 15:37:14 +02:00
Stefan 63e58ba035 feat: add banner support for communities
Add banner image as a special `IdentityImage` beside "thumbnail" and "large"

Banner input cropped image processing

- Resize to keep in the limits of `BannerDim`
- Encode to match the file size limits define for banner
- Don't scale up. This can be done efficiently in the UI

Changes to `images` module

- Refactor `EncodeToBestSize` as `EncodeToLimits` to accept arbitrary dimensions
  and allow for custom size
- Define `DimensionLimits` for banner not to exceed 450 KB and a rough estimate
  for the ideal size
2022-05-27 14:42:14 +03:00
Vitaliy Vlasov 16197dc807 Sync profile picture 2022-04-21 19:50:31 +03:00
Shivek Khurana a6e7ff6ddd
🖼 Set any url as profile picture (useful for NFTs) (#2367)
* Sound check
* Add DecodeImageURL fn
* Introduce crop dynamics
* Add center crop calculations png

* Apply suggestions from code review
Co-authored-by: RichΛrd <info@richardramos.me>

* Fix lint
* Rebase and update version
Co-authored-by: RichΛrd <info@richardramos.me>
2021-09-21 14:30:44 +05:30
Andrea Maria Piana 58f2dac673 Remove image log 2020-12-17 14:10:00 +01:00
Samuel Hawksby-Robinson ca80140c1a Resolved broken tests 2020-12-17 14:10:00 +01:00
Andrea Maria Piana 1adfa38611 Check hash in shouldPublish 2020-12-17 14:10:00 +01:00
Andrea Maria Piana 618524d8cb debug 2020-12-17 14:10:00 +01:00
Samuel Hawksby-Robinson 79f2b0bcc7 Address consistent json field case convention - use camelCase 2020-12-17 14:10:00 +01:00
Samuel Hawksby-Robinson 5aa8492315 Fix failing tests 2020-12-17 14:10:00 +01:00
Samuel Hawksby-Robinson a77a40fdf4 Resolved linting issues 2020-12-17 14:10:00 +01:00
Samuel Hawksby-Robinson 2d72d21498 Rename file now that db logic has been moved 2020-12-17 14:10:00 +01:00
Samuel Hawksby-Robinson 193ab30ada Refactor injecting multiaccounts into messenger and service 2020-12-17 14:10:00 +01:00
Samuel Hawksby-Robinson 7b230d5c9d Updated message handling from public and private chat 2020-12-17 14:10:00 +01:00
Samuel Hawksby-Robinson 8be391fc79 Bug fix for nil pointer on image save 2020-12-17 14:10:00 +01:00
Samuel Hawksby-Robinson 9545f8e306 Added log to debug an image store nil pointer panic 2020-12-17 14:10:00 +01:00
Samuel Hawksby-Robinson a564066c4f Added public chat ChatIdentity publish 2020-12-17 14:10:00 +01:00
Samuel Hawksby-Robinson 48a34072bb Added ChatIdentity attachment to ContactCodeAdvert 2020-12-17 14:10:00 +01:00
Samuel Hawksby-Robinson dcee7f8de7 Changed identity_images column name to name 2020-12-17 14:10:00 +01:00
Samuel Hawksby-Robinson 2960fc49d4 Implemented GetImages and StoreImages in API 2020-12-17 14:10:00 +01:00
Samuel Hawksby-Robinson a7358fcd3f images package tidy up 2020-12-17 14:10:00 +01:00
Samuel Hawksby-Robinson 7ea153bae1 Added Identity Image Database delete 2020-12-17 14:10:00 +01:00
Samuel Hawksby-Robinson daa5ca1dbd Added GetIdentityImage by image name 2020-12-17 14:10:00 +01:00
Samuel Hawksby-Robinson aad761b24b Added IdentityImage Database store and get tests 2020-12-17 14:10:00 +01:00
Samuel Hawksby-Robinson df55822e29 Added StoreIdentityImages to Database 2020-12-17 14:10:00 +01:00
Samuel Hawksby-Robinson 01657b4665 Added IdentityImage JSON marshalling tests 2020-12-17 14:10:00 +01:00
Samuel Hawksby-Robinson 7beebaaf92 Added images/database functionality 2020-12-17 14:10:00 +01:00
Samuel Hawksby-Robinson 1b59d088d8 Integrated GetMimeType() 2020-12-17 14:10:00 +01:00
Samuel Hawksby-Robinson 8ec0ec4341 Added TestEncodeToBestSize() 2020-12-17 14:10:00 +01:00
Samuel Hawksby-Robinson 3b7fbf94d3 Added SaveProfileImage endpoint
Also added EncodeToBestSize func
2020-12-17 14:10:00 +01:00
Samuel Hawksby-Robinson 9bc240fc71 Improved Resize() and added tests 2020-12-17 14:10:00 +01:00
Samuel Hawksby-Robinson a6df8adeba Renamed Decoding and Encoding funcs 2020-12-17 14:10:00 +01:00
Samuel Hawksby-Robinson 0d6e6699ec Split out encode code from decode, same for tests 2020-12-17 14:10:00 +01:00
Samuel Hawksby-Robinson 36105aaac0 Split out encode code from decode, same for tests 2020-12-17 14:10:00 +01:00
Samuel Hawksby-Robinson e635869dd5 Renamed file.go to decode.go 2020-12-17 14:10:00 +01:00
Samuel Hawksby-Robinson aec4e43470 Tidy up of unneeded code 2020-12-17 14:10:00 +01:00
Samuel Hawksby-Robinson bb1e232ffe Improved images.Crop() and implemented testing 2020-12-17 14:10:00 +01:00