Comments (3)
Rather than write an output file to temp can a processed image be returned via stdout ?
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 --glob-input
currently always require --glob-output
to be present, and this mode doesn't currently support stdout.
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 }
after about 70 files I get format error but no file ref. The directory does inc files other than jpg,jpeg and png.
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 :).
Rather than write an output file to temp can a processed image be returned via stdout ?
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
B) know where one image ends, and the next begins (e.g. a next line in jsonlines).
* some are guessable by their file header
from sic.
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.
sic.exe --output-format jpg --input "G:\Temp\test\IMG_6344.PNG" --resize 200 200
>> empty blob
The error is as follows.
Error: Unable to save image.
Caused by:
0: The decoder for Jpeg does not support the color type Rgba16
1: The decoder for Jpeg does not support the color type Rgba16
if the output format is png with same file the blob is returned.
from sic.
after about 70 files I get format error but no file ref. The directory does inc files other than jpg,jpeg and png.
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.
I added error context in #1555.
Released as 0.22.2.
from sic.
Related Issues (20)
- upgrade image to v0.24.0
- Consider replacing imageproc with our own variants, to no longer have the image + imageproc sync dependency problem
- Conceptualize: new cli ideas
- cargo release did not publish packages HOT 1
- image-script
- drop-shadow
- Enable `webp` encoding support HOT 1
- How to use `stdin`? HOT 4
- Add preview command
- bors is deprecated
- Operation Range of Units HOT 1
- Add apng and animated webp support
- AutomaticColorTypeAdjustment setting is ignored
- milestone-planning: 0.19.0
- Add Porter-Duff image composition
- Add `horizontal-gradient` to readme and changelog
- codecov: re-add and fix code coverage (coverage results are 0%)
- sic/operations: Image thresholding HOT 6
- milestone-planning: 0.20.0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sic.