Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
I have Box drive on Windows. I use it as a regular folder on the computer. I can store images there. When I store a small number of images (on the order of a couple hundreds) and I do not wait lon...
#3: Post edited
- I have Box drive on Windows. I use it as a regular folder on the computer. I can store images there.
- When I store a small number of images (on the order of a couple hundreds) and I do not wait long to access them (on the order of a month), I do not have problems accessing them.
- When I store a large number of images (on the order of thousands), I have the following problems:
- 1) reading them in Python with `opencv` function `cv2.imread()` always gives me a reading error after some image (`cannot open/read file`) (i.e., it reads first several images, but then it starts giving me the error),
- 2) copying the entire images folder from the Box drive to my hard drive using Windows' copy command may or may not result in a copying error at some image (i.e., it starts copying, it copies first several images, then it gives me the error).
- Note, once I have copied all the images to my hard drive, the same Python code for images reading works without a problem (it also works way faster, but that is a whole other story).
- This has been happening for a couple of years, on different Windows updates, conda updates, Python updates, `opencv` updates and spanning at least 10 different codes I wrote.
- I think it is a general problem related to the way Box drive handles files.
- **If I am correct, I am wondering if anybody can explain to me, please, why Box drive does that and how to mitigate that.**
- --------------------------------------------------------------------
- I do not know what code or error messages to provide here. I am interested in a general explanation and solution. However, if you need something like that to give me the answer, please, guide me what exactly I should provide.
- I have Box drive on Windows. I use it as a regular folder on the computer. I can store images there.
- When I store a small number of images (on the order of a couple hundreds) and I do not wait long to access them (on the order of a month), I do not have problems accessing them.
- When I store a large number of images (on the order of thousands), I have the following problems:
- 1) reading them in Python with `opencv` function `cv2.imread()` always gives me a reading error after some image (`cannot open/read file`) (i.e., it reads first several images, but then it starts giving me the error),
- 2) copying the entire images folder from the Box drive to my hard drive using Windows' copy command may or may not result in a copying error at some image (i.e., it starts copying, it copies first several images, then it gives me the error).
- Note, once I have copied all the images to my hard drive, the same Python code for images reading works without a problem (it also works way faster, but that is a whole other story).
- This has been happening for a couple of years, on different Windows updates, conda updates, Python updates, `opencv` updates and spanning at least 10 different codes I wrote.
- I think it is a general problem related to the way Box drive handles files.
- **If I am correct, I am wondering if anybody can explain to me, please, why Box drive does that and how to mitigate that.**
- --------------------------------------------------------------------
- I do not know what code or error messages to provide here. I am interested in a general explanation and solution. However, if you need something like that to give me the answer, please, guide me what exactly I should provide.
- --------------------------------------------------------------------
- Per Alexei's requirement, I am posting the error I receive when I am trying to read images from a Box folder with `opencv-python` (even though I am sure it's pointless, the problem is not in `opencv` as I discussed above, the problem in Box drive):
- `[ WARN:0@6.190] global C:\b\abs_d8ltn27ay8\croot\opencv-suite_1676452046667\work\modules\imgcodecs\src\loadsave.cpp (239) cv::findDecoder imread_('21.06.24 PIV with shadowgraphy images\BackgroundImages\ShadowgraphyImages.7udrx7mu.000004-1196.2040.a.jpg'): can't open/read file: check file path/integrity`
- As you may notice, the name of the image file contains the number *000004*. This number means that this is the *5th* pair of images in the folder or the *9th* image. I.e., `opencv` read the first *8* images and then something happened preventing it from reading the *9th* one.
#2: Post edited
How to make Box drive have the files prepared for access when I need it?
I have Box drive on Windows. I use it as a regular folder on the computer. I can store images there. When I store a small number of images (on the order of a couple hundreds) and I do not wait long to access them (on the order of a month), I do not have problems accessing them. When I store a large number of images (on the order of thousands), I have the following problems: 1) reading them in Python with `opencv` function `cv2.imread()` always gives me a reading error after some image (`cannot open/read file`) (i.e., it reads first several images, but then it starts giving me the error), 2) copying the entire images folder from the Box drive to my hard drive using Windows' copy command may or may not result in a copying error at some image (i.e., it starts copying, it copies first several images, then it gives me the error). Note, once I have copied all the images to my hard drive, the same Python code for images reading works without a problem (it also works way faster, but that is a whole other story). This has been happening for a couple of years, on different Windows updates, conda updates, Python updates, `opencv` updates and spanning at least 10 different codes I wrote. I think it is a general problem related to the way Box drive handles files. **If I am correct, I am wondering if anybody can explain to me, please, why Box drive does that and how to mitigate that.** -------------------------------------------------------------------- I do not know what code or error messages to provide here. I am interested in a general explanation and solution. However, if you need something like that to give me the answer, please, guide me what exactly I should provide.
#1: Initial revision
How to make Box drive have the files prepared for access when I need it?
I have Box drive on Windows. I use it as a regular folder on the computer. I can store images there. When I store a small number of images (on the order of a couple hundreds) and I do not wait long to access them (on the order of a month), I do not have problems accessing them. When I store a large number of images (on the order of thousands), I have the following problems: 1) reading them in Python with `opencv` function `cv2.imread()` always gives me a reading error after some image (`cannot open/read file`) (i.e., it reads first several images, but then it starts giving me the error), 2) copying the entire images folder from the Box drive to my hard drive using Windows' copy command may or may not result in a copying error at some image (i.e., it starts copying, it copies first several images, then it gives me the error). Note, once I have copied all the images to my hard drive, the same Python code for images reading works without a problem (it also works way faster, but that is a whole other story). This has been happening for a couple of years, on different Windows updates, conda updates, Python updates, `opencv` updates and spanning at least 10 different codes I wrote. I think it is a general problem related to the way Box drive handles files. **If I am correct, I am wondering if anybody can explain to me, please, why Box drive does that and how to mitigate that.** -------------------------------------------------------------------- I do not know what code or error messages to provide here. I am interested in a general explanation and solution. However, if you need something like that to give me the answer, please, guide me what exactly I should provide.