Would be nice to share this with original file save but follows different process sorta
(self)
| 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, |
no test coverage detected