Closed karamanolev closed 7 years ago
The input file is already completely loaded into memory.
Seems to me that fseek
is only used to determine the necessary size of the char[]
array the file is being read into:
https://github.com/google/guetzli/blob/9bfa01f247b24dc45eb61912ec42a9a2b6a4cd95/guetzli/guetzli.cc#L143
Maybe a std::vector
plus read loop could fix the problem here?
Yes, something like that should fix this issue. Feel free to send a PR, otherwise I'll do it sometime this week.
This a mostly standard feature on many command-line tools that I've used and it would be great if guetzli supported it too. With the current version, passing
/dev/stdout
for the output file works OK, using/dev/stdin
does not due to guetzli trying to seek on it. If the seeks are really needed, I guess even loading the whole input in memory shouldn't be such a problem, due to the already gigantic memory requirements.