MCPcopy Create free account
hub / github.com/diffgram/diffgram / save_raw_image_thumb

Method save_raw_image_thumb

walrus/methods/input/process_media.py:1929–1948  ·  view source on GitHub ↗

Would be nice to share this with original file save but follows different process sorta

(self)

Source from the content-addressed store, hash-verified

1927 # Now Save Tokens
1928
1929 def save_raw_image_thumb(self):
1930 """
1931 Would be nice to share this with original file save
1932 but follows different process sorta
1933 """
1934
1935 # Save Thumb
1936 self.new_image.url_signed_thumb_blob_path = f"{self.new_image.url_signed_blob_path}_thumb"
1937
1938 thumbnail_image = imresize(self.raw_numpy_image, (160, 160))
1939
1940 new_temp_filename = f"{self.input.temp_dir}/resized.jpg"
1941
1942 imwrite(new_temp_filename, thumbnail_image, quality = 95)
1943
1944 data_tools.upload_to_cloud_storage(
1945 temp_local_path = new_temp_filename,
1946 blob_path = self.new_image.url_signed_thumb_blob_path,
1947 content_type = "image/jpg",
1948 )
1949
1950 def get_and_set_width_and_height(
1951 self,

Callers 1

Calls 2

imresizeFunction · 0.90

Tested by

no test coverage detected