nationaldronesau/FlirImageExtractor

saving rgb images as well is missing

Closed this issue · 2 comments

I propose adding this to the end of save_image():

    if self.rgb_image_np is not None:
        img_rgb = Image.fromarray(self.rgb_image_np)
        if bytesIO:
            bytes = io.BytesIO()
            img_rgb.save(bytes, "jpeg", quality=100)
            return_array.append(bytes)
        else:
            rgb_output_filename_array = os.path.splitext(self.flir_img_filename)
            filename = (
                rgb_output_filename_array[0]
                + "_rgb"
                + rgb_output_filename_array[1]
            )
            if self.is_debug:
                logger.debug("Saving Rgb image to:{}".format(filename))

            img_rgb.save(filename, "jpeg", quality=100)
            return_array.append(filename)

@vasarhelyi that is a good proposal, did you tried?

Yes, I needed it so I modified my repo this way and posted the changes afterwards. But I did not put much effort into it to test thorougly and to be a pull request, but feel free to use any of it if you wish.