Forum

Author Topic: Help with ImageCompression  (Read 2641 times)

Andrey Vakhtanov

  • Newbie
  • *
  • Posts: 14
    • View Profile
Help with ImageCompression
« on: October 12, 2022, 04:24:26 PM »
Good time!

I try to set some parametrs for image compression for networktask in version 1.8.2
Image format tiff

Code: [Select]
img_compress_def = PhotoScan_API.ImageCompression
img_compress_def.tiff_big = False
img_compress_def.tiff_tiled = False
img_compress_def.tiff_overviews = True
img_compress_def.tiff_compression = PhotoScan_API.ImageCompression.TiffCompressionDeflate
exportIUST_TIF_task.params['image_compression'] = img_compress_def

on stage generting task I get error
Code: [Select]
File "*****************/**************.py", line 1664, in DemOrthoExport img_compress_def.tiff_overviews = True
 AttributeError: 'Metashape.ImageCompression' object attribute 'tiff_overviews' is read-only
only for tiff_overviews attribute

Where is the problem?

Andrey Vakhtanov

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: Help with ImageCompression
« Reply #1 on: October 12, 2022, 04:51:36 PM »
Restart metashape and problem is go out.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15083
    • View Profile
Re: Help with ImageCompression
« Reply #2 on: October 12, 2022, 05:02:12 PM »
Hello Andrey,

You should fix the first line in the assignment to:
Code: [Select]
img_compress_def = PhotoScan_API.ImageCompression()
Executing the line without the brackets in the end could "break" the Python interpreter in the current instance/thread.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Andrey Vakhtanov

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: Help with ImageCompression
« Reply #3 on: October 12, 2022, 05:41:24 PM »
Thanks!
It help me. I called the class ImageCompression apper witout '()'