-
Notifications
You must be signed in to change notification settings - Fork 6
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
Is it possible to return a blob via stdout #1547
Comments
For individual files, you can do the following to get a blob: sic --output-format png --input .\resources\logo\sic_500.jpg --resize 200 200 >> out.png Files which use Looking at your paths, I think you're on Windows; as a workaround you could use the following Powershell: Get-ChildItem -Recurse ".\resources" -Include "*.jpg","*.jpeg","*.png" | ForEach-Object { sic --input $_.FullName --output somedir/$($_.Name) --resize 200 200 } For your directories: Get-ChildItem -Recurse "G:/Temp" -Include "*.jpg","*.jpeg","*.png" | ForEach-Object { sic --input $_.FullName --output C:/Users/Paul/AppData/Local/Temp/youdocms/$($_.Name) --resize 200 200 }
That's not good! I should improve the error message and/or add a flag to allow for (silent/with a warning to stderr) failures. If you still have the exact error that would be helpful :).
Say that I would implement this, in what way would you expect the different images to be output? i.e. if you have a stream of byte buffers, how do you: A) know the type of the output file* (e.g. png, jpg, bmp), and * some are guessable by their file header |
Thank you for reply. I have this working via blob or file and looping through the files. Not getting the format error. I will try to track down the file that is causing the problem if I try to process a directory. However if using individual files with blob output the blob is only created if the output format matches the input.
The error is as follows. Error: Unable to save image. Caused by: if the output format is png with same file the blob is returned. |
Rather than write an output file to temp can a processed image be returned via stdout ?
I am running latest 0.22 on a folder as follows.
sic --glob-input "G:/Temp/*.{jpg, jpeg, png}" --glob-output "C:/Users/Paul/AppData/Local/Temp/youdocms" --resize 200 200
after about 70 files I get format error but no file ref. The directory does inc files other than jpg,jpeg and png.
Thanks
Paul
The text was updated successfully, but these errors were encountered: