Skip to content

Commit

Permalink
resize functions changed
Browse files Browse the repository at this point in the history
  • Loading branch information
dbuscombe-usgs committed Jun 12, 2023
1 parent 6d11b14 commit db14a6a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions doodleverse_utils/imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,11 @@ def do_resize_label(lfile, TARGET_SIZE):
fdir = os.path.dirname(lfile)
fdirout = fdir.replace(wend,'resized_'+wend)

f_out = fdirout+os.sep+lfile.split(os.sep)[-1].replace('.jpg','.png')
f_out = f_out.replace(f_out.split(os.sep)[-1],'images'+os.sep+f_out.split(os.sep)[-1])

# save result
imsave(fdirout+os.sep+lfile.split(os.sep)[-1].replace('.jpg','.png'), result.astype('uint8'), check_contrast=False, compression=0)
imsave(f_out, result.astype('uint8'), check_contrast=False, compression=0)


#-----------------------------------
Expand All @@ -250,6 +253,9 @@ def do_resize_image(f, TARGET_SIZE):
fdir = os.path.dirname(f)
fdirout = fdir.replace(wend,'resized_'+wend)

f_out = fdirout+os.sep+f.split(os.sep)[-1].replace('.jpg','.png')
f_out = f_out.replace(f_out.split(os.sep)[-1],'images'+os.sep+f_out.split(os.sep)[-1])

# save result
imsave(fdirout+os.sep+f.split(os.sep)[-1].replace('.jpg','.png'), result.astype('uint8'), check_contrast=False, compression=0)
imsave(f_out, result.astype('uint8'), check_contrast=False, compression=0)

0 comments on commit db14a6a

Please sign in to comment.