Hello, Due to the changes in Pharo 3.0, I cannot write jpeg files on the disk. This happens because when writing a jpeg file, we delete any precedent version of the file to be exported. However, now DiskStore>>delete: throws an exception when the file to be deleted is not present delete: path | pathString encodedPathString | (self exists: path) ifFalse: [ ^ FileDoesNotExist signalWith: path ]. ... Hence, we need to fix PluginBasedJPEGReadWriter>>putForm: quality: progressiveJPEG: onFileNamed: to not delete files not present. To reproduce the problem: Display writeJPEGfileNamed: 'display.jpeg' progressive: true If confirmed, I'll open a bug report and propose a slice because correction is quite simple ;) regards, Usman
https://pharo.fogbugz.com/f/cases/12073/Writing-jpeg-files-to-disk On Tue, Nov 5, 2013 at 11:34 AM, Usman Bhatti <usman.bhatti@gmail.com>wrote:
Hello,
Due to the changes in Pharo 3.0, I cannot write jpeg files on the disk. This happens because when writing a jpeg file, we delete any precedent version of the file to be exported. However, now DiskStore>>delete: throws an exception when the file to be deleted is not present
delete: path | pathString encodedPathString | (self exists: path) ifFalse: [ ^ FileDoesNotExist signalWith: path ]. ...
Hence, we need to fix PluginBasedJPEGReadWriter>>putForm: quality: progressiveJPEG: onFileNamed: to not delete files not present.
To reproduce the problem: Display writeJPEGfileNamed: 'display.jpeg' progressive: true
If confirmed, I'll open a bug report and propose a slice because correction is quite simple ;)
regards, Usman
Here is a slice the corrects the bug. I cannot commit to pharo inbox. Usman On Tue, Nov 5, 2013 at 11:49 AM, Usman Bhatti <usman.bhatti@gmail.com>wrote:
https://pharo.fogbugz.com/f/cases/12073/Writing-jpeg-files-to-disk
On Tue, Nov 5, 2013 at 11:34 AM, Usman Bhatti <usman.bhatti@gmail.com>wrote:
Hello,
Due to the changes in Pharo 3.0, I cannot write jpeg files on the disk. This happens because when writing a jpeg file, we delete any precedent version of the file to be exported. However, now DiskStore>>delete: throws an exception when the file to be deleted is not present
delete: path | pathString encodedPathString | (self exists: path) ifFalse: [ ^ FileDoesNotExist signalWith: path ]. ...
Hence, we need to fix PluginBasedJPEGReadWriter>>putForm: quality: progressiveJPEG: onFileNamed: to not delete files not present.
To reproduce the problem: Display writeJPEGfileNamed: 'display.jpeg' progressive: true
If confirmed, I'll open a bug report and propose a slice because correction is quite simple ;)
regards, Usman
I added you to the PharoInbox, could you commit again? On 2013-11-05, at 11:54, Usman Bhatti <usman.bhatti@gmail.com> wrote:
Here is a slice the corrects the bug. I cannot commit to pharo inbox.
Usman
On Tue, Nov 5, 2013 at 11:49 AM, Usman Bhatti <usman.bhatti@gmail.com> wrote: https://pharo.fogbugz.com/f/cases/12073/Writing-jpeg-files-to-disk
On Tue, Nov 5, 2013 at 11:34 AM, Usman Bhatti <usman.bhatti@gmail.com> wrote: Hello,
Due to the changes in Pharo 3.0, I cannot write jpeg files on the disk. This happens because when writing a jpeg file, we delete any precedent version of the file to be exported. However, now DiskStore>>delete: throws an exception when the file to be deleted is not present
delete: path | pathString encodedPathString |
(self exists: path) ifFalse: [ ^ FileDoesNotExist signalWith: path ].
...
Hence, we need to fix PluginBasedJPEGReadWriter>>putForm: quality: progressiveJPEG: onFileNamed: to not delete files not present.
To reproduce the problem: Display writeJPEGfileNamed: 'display.jpeg' progressive: true
If confirmed, I'll open a bug report and propose a slice because correction is quite simple ;)
regards, Usman
<Graphics-Files-usmanbhatti.48.mcz><SLICE-Issue-12073-Writing-jpeg-files-to-disk-usmanbhatti.1.mcz>
On Tue, Nov 5, 2013 at 2:36 PM, Camillo Bruni <camillobruni@gmail.com>wrote:
I added you to the PharoInbox, could you commit again?
Thanx and done.
On 2013-11-05, at 11:54, Usman Bhatti <usman.bhatti@gmail.com> wrote:
Here is a slice the corrects the bug. I cannot commit to pharo inbox.
Usman
On Tue, Nov 5, 2013 at 11:49 AM, Usman Bhatti <usman.bhatti@gmail.com> wrote: https://pharo.fogbugz.com/f/cases/12073/Writing-jpeg-files-to-disk
On Tue, Nov 5, 2013 at 11:34 AM, Usman Bhatti <usman.bhatti@gmail.com> wrote: Hello,
Due to the changes in Pharo 3.0, I cannot write jpeg files on the disk. This happens because when writing a jpeg file, we delete any precedent version of the file to be exported. However, now DiskStore>>delete: throws an exception when the file to be deleted is not present
delete: path | pathString encodedPathString |
(self exists: path) ifFalse: [ ^ FileDoesNotExist signalWith: path ].
...
Hence, we need to fix PluginBasedJPEGReadWriter>>putForm: quality: progressiveJPEG: onFileNamed: to not delete files not present.
To reproduce the problem: Display writeJPEGfileNamed: 'display.jpeg' progressive: true
If confirmed, I'll open a bug report and propose a slice because correction is quite simple ;)
regards, Usman
<Graphics-Files-usmanbhatti.48.mcz><SLICE-Issue-12073-Writing-jpeg-files-to-disk-usmanbhatti.1.mcz>
Could please have a look so that I can suggest an appropriate fix? https://pharo.fogbugz.com/f/cases/12073/Writing-jpeg-files-to-disk Usman On Tue, Nov 5, 2013 at 2:36 PM, Camillo Bruni <camillobruni@gmail.com>wrote:
I added you to the PharoInbox, could you commit again?
On 2013-11-05, at 11:54, Usman Bhatti <usman.bhatti@gmail.com> wrote:
Here is a slice the corrects the bug. I cannot commit to pharo inbox.
Usman
On Tue, Nov 5, 2013 at 11:49 AM, Usman Bhatti <usman.bhatti@gmail.com> wrote: https://pharo.fogbugz.com/f/cases/12073/Writing-jpeg-files-to-disk
On Tue, Nov 5, 2013 at 11:34 AM, Usman Bhatti <usman.bhatti@gmail.com> wrote: Hello,
Due to the changes in Pharo 3.0, I cannot write jpeg files on the disk. This happens because when writing a jpeg file, we delete any precedent version of the file to be exported. However, now DiskStore>>delete: throws an exception when the file to be deleted is not present
delete: path | pathString encodedPathString |
(self exists: path) ifFalse: [ ^ FileDoesNotExist signalWith: path ].
...
Hence, we need to fix PluginBasedJPEGReadWriter>>putForm: quality: progressiveJPEG: onFileNamed: to not delete files not present.
To reproduce the problem: Display writeJPEGfileNamed: 'display.jpeg' progressive: true
If confirmed, I'll open a bug report and propose a slice because correction is quite simple ;)
regards, Usman
<Graphics-Files-usmanbhatti.48.mcz><SLICE-Issue-12073-Writing-jpeg-files-to-disk-usmanbhatti.1.mcz>
Hi usman I'm wondering if the change we did is good. Too late right now to think. I'm wondering if this is important to know that we are deleting a non existing file. Stef
Hello,
Due to the changes in Pharo 3.0, I cannot write jpeg files on the disk. This happens because when writing a jpeg file, we delete any precedent version of the file to be exported. However, now DiskStore>>delete: throws an exception when the file to be deleted is not present
delete: path | pathString encodedPathString |
(self exists: path) ifFalse: [ ^ FileDoesNotExist signalWith: path ].
...
Hence, we need to fix PluginBasedJPEGReadWriter>>putForm: quality: progressiveJPEG: onFileNamed: to not delete files not present.
To reproduce the problem: Display writeJPEGfileNamed: 'display.jpeg' progressive: true
If confirmed, I'll open a bug report and propose a slice because correction is quite simple ;)
regards, Usman
On Sat, Nov 9, 2013 at 2:40 AM, Stéphane Ducasse <stephane.ducasse@inria.fr>wrote:
Hi usman
I'm wondering if the change we did is good.
Too late right now to think. So far the change is not integrated so we can still think over it.
I'm wondering if this is important to know that we are deleting a non existing file.
Yes it is because now Pharo throws an exception if we do that. Try this in the latest 3.0 image: Display writeJPEGfileNamed: 'display.jpeg' progressive: true I proposed a solution by changing delete to ensureDelete but the change was rejected because it is advised to backup the deleted file before replacing it. However, the other image types are overwritten without any error checking. For example ImageReadWrite: putForm: aForm onFileNamed: fileName "Store the given form on a file of the given name." | writer | writer := self on: (FileStream newFileNamed: fileName) binary. Cursor write showWhile: [ writer nextPutImage: aForm ]. writer close So, we can retain the same policy for PluginBasedJPEGReadWriter. usman
Stef
Hello,
Due to the changes in Pharo 3.0, I cannot write jpeg files on the disk. This happens because when writing a jpeg file, we delete any precedent version of the file to be exported. However, now DiskStore>>delete: throws an exception when the file to be deleted is not present
delete: path | pathString encodedPathString |
(self exists: path) ifFalse: [ ^ FileDoesNotExist signalWith: path ].
...
Hence, we need to fix PluginBasedJPEGReadWriter>>putForm: quality: progressiveJPEG: onFileNamed: to not delete files not present.
To reproduce the problem: Display writeJPEGfileNamed: 'display.jpeg' progressive: true
If confirmed, I'll open a bug report and propose a slice because correction is quite simple ;)
regards, Usman
On Nov 9, 2013, at 7:52 PM, Usman Bhatti <usman.bhatti@gmail.com> wrote:
On Sat, Nov 9, 2013 at 2:40 AM, Stéphane Ducasse <stephane.ducasse@inria.fr> wrote: Hi usman
I'm wondering if the change we did is good. Too late right now to think.
So far the change is not integrated so we can still think over it.
I'm wondering if this is important to know that we are deleting a non existing file.
Yes
why? Usman my question was if my change made sense. May be nobody care that when we are deleting a file it should exist. Else I understand your point. In any case open a bug entry. Stef
it is because now Pharo throws an exception if we do that. Try this in the latest 3.0 image: Display writeJPEGfileNamed: 'display.jpeg' progressive: true
I proposed a solution by changing delete to ensureDelete but the change was rejected because it is advised to backup the deleted file before replacing it. However, the other image types are overwritten without any error checking. For example ImageReadWrite:
putForm: aForm onFileNamed: fileName "Store the given form on a file of the given name." | writer | writer := self on: (FileStream newFileNamed: fileName) binary. Cursor write showWhile: [ writer nextPutImage: aForm ]. writer close
So, we can retain the same policy for PluginBasedJPEGReadWriter.
usman
Stef
Hello,
Due to the changes in Pharo 3.0, I cannot write jpeg files on the disk. This happens because when writing a jpeg file, we delete any precedent version of the file to be exported. However, now DiskStore>>delete: throws an exception when the file to be deleted is not present
delete: path | pathString encodedPathString |
(self exists: path) ifFalse: [ ^ FileDoesNotExist signalWith: path ].
...
Hence, we need to fix PluginBasedJPEGReadWriter>>putForm: quality: progressiveJPEG: onFileNamed: to not delete files not present.
To reproduce the problem: Display writeJPEGfileNamed: 'display.jpeg' progressive: true
If confirmed, I'll open a bug report and propose a slice because correction is quite simple ;)
regards, Usman
participants (3)
-
Camillo Bruni -
Stéphane Ducasse -
Usman Bhatti