Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Size and count parameters don't work #2

Closed
AlexeyKupershtokh opened this issue Apr 5, 2021 · 0 comments · Fixed by #3
Closed

Size and count parameters don't work #2

AlexeyKupershtokh opened this issue Apr 5, 2021 · 0 comments · Fixed by #3

Comments

@AlexeyKupershtokh
Copy link

  • pydngconverter version: 0.20
  • Python version: 3.8.5
  • Operating System: Windows 10

Description

I've been trying to generate resized dng using side and count parameters. But there's a bug which prevents args passed to the .exe treated properly.

What I Did

I took the example and added side=600 to it

#!/usr/local/bin/python
# -*- coding: utf-8 -*-

import asyncio
from pydngconverter import DNGConverter, flags

path = 'nef\\'
dest = 'dng\\'

async def main():
    pydng = DNGConverter(path,                        
                        dest=dest,
                        jpeg_preview=flags.JPEGPreview.NONE,
                        fast_load=False,
                        side=600,
                        lossy=flags.LossyCompression.YES,
                        debug=True
                        )

    # Convert all
    return await pydng.convert()

loop = asyncio.get_event_loop()
loop.run_until_complete(main())
loop.close()

Expected result

Get files with 600px longest side.

Actual result

Got files with original size.

Fix:

You need to separate arguments from each other, something like this:

        if self.side:
            yield f"-side"
            yield f"{self.side}"
        if self.count:
            yield f"-count"
            yield f"{self.count}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant