In C++ we have from_file and from_bytes.
In Rust we have from_file and from_file_contents.
Basically we have two sources we care about:
A file path
The contents of a file
from_file_contents is very descriptive, so I think it winds out over from_byte.
from_file isn't great though - I could easily see someone be confused and pass a path to that (which I would not be surprised if it worked on some C++ compilers).
So I suggest we go with: from_file_path and from_file_contents.
Or shorten it to: from_path and from_contents.
Whatever we chose, we should pick the same for the new ImageEncoded.
We should also keep the old functions with a deprecation marker.
Python
In Python we use named arguments instead, and those are named path and contents, which I think are good, and go well with the suggested names.
In C++ we have
from_file
andfrom_bytes
. In Rust we havefrom_file
andfrom_file_contents
.Basically we have two sources we care about:
from_file_contents
is very descriptive, so I think it winds out overfrom_byte
.from_file
isn't great though - I could easily see someone be confused and pass a path to that (which I would not be surprised if it worked on some C++ compilers).So I suggest we go with:
from_file_path
andfrom_file_contents
. Or shorten it to:from_path
andfrom_contents
.Whatever we chose, we should pick the same for the new
ImageEncoded
.We should also keep the old functions with a deprecation marker.
Python
In Python we use named arguments instead, and those are named
path
andcontents
, which I think are good, and go well with the suggested names.