Forum

Author Topic: can't load photos  (Read 6864 times)

Roy

  • Newbie
  • *
  • Posts: 22
    • View Profile
can't load photos
« on: November 24, 2015, 12:32:57 PM »
Hi.

i have a JPG image list that i'm trying to load to a chunk I created using this code :

import os, PhotoScan
doc = PhotoScan.app.document
myChunk = doc.addChunk()
path_photos = PhotoScan.app.getExistingDirectory("Specify folder with input photos:")
path_photos += "/"
project_path = PhotoScan.app.getSaveFileName("Specify project filename for saving:")
image_list = os.listdir(path_photos)
for myP in image_list:
        if("JPG") in myP:
            myChunk.addPhotos(path_photos + myP)

but it can't load the photos throwing this error:

"2015-11-24 11:28:31 Error: Can't load photos"



Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15433
    • View Profile
Re: can't load photos
« Reply #1 on: November 24, 2015, 12:54:30 PM »
Hello Roy,

argument to .addPhotos() should be a list of paths.

So I'd rather modify the script as following:
Code: [Select]
paths = list()
for myP in image_list:
   paths.append(path_photos += myP)
myChunk.addPhotos(paths)
Best regards,
Alexey Pasumansky,
Agisoft LLC

Roy

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: can't load photos
« Reply #2 on: November 24, 2015, 01:03:58 PM »
thanks!

it works now.

until the next problem :)

Roy