Opened 11 years ago

Closed 10 years ago

#3044 closed bug (fixed)

[JPEG2000] shows an alert if it can't find his settings (easy)

Reported by: diver Owned by: axeld
Priority: normal Milestone: R1
Component: Add-Ons/Translators Version: R1/pre-alpha1
Keywords: Cc: fredrik@…
Blocked By: Blocking:
Has a Patch: no Platform: All

Description


Attachments (2)

jpeg2000.png (124.2 KB) - added by diver 11 years ago.
3304.diff (4.1 KB) - added by richy_rich 10 years ago.
patch for issue 3044

Download all attachments as: .zip

Change History (12)

Changed 11 years ago by diver

Attachment: jpeg2000.png added

comment:1 Changed 11 years ago by diver

Summary: [JPEG2000] shows an alert if it can't find his settings[JPEG2000] shows an alert if it can't find his settings (easy)

comment:2 Changed 10 years ago by modeenf

Cc: fredrik@… added

And the solution are to remove that alert? or are the image a propose how it can look and the hedline shoul be "show an alert if it can't find his settings"?

comment:3 Changed 10 years ago by diver

I mean that no other translator show such alert and silently creates one if needed. Also note that alert message is about incompatible settings file, but there were no settings file before, as this is the first time I opened JPEG2000 image.

comment:4 Changed 10 years ago by richy_rich

Hi, I've attached a path for this.

With this patch the alert is now only shown if the translator attempts to read a settings file and fails (i.e. it's corrupt or otherwise incompatible - as suggested in the message).

In the case of there not being a settings file the translator will silently create the default (this is also the behaviour of the other translators as far as I can see).

Cheers,

Richy

comment:5 Changed 10 years ago by jackburton

A translator should never show an alert, since it could be used from a command line application. The JPEG translator had also this issue, and was fixed by removing the code which showed the alert. If anything, you could dump a message to the syslog.

comment:6 Changed 10 years ago by richy_rich

Ok, I'll ammend the patch to remove all the alerts and check the other translators.

comment:7 Changed 10 years ago by richy_rich

Actually, the jpeg translator can still show an alert in the same circumstances (corrupt or unreadable settings file) just not when it's silently creating one. The attached patch brings the j2k translator into line with this.

Should I remove the other alert from both?

comment:8 Changed 10 years ago by stippi

Yes, please! Thanks a lot for the work!

Changed 10 years ago by richy_rich

Attachment: 3304.diff added

patch for issue 3044

comment:9 Changed 10 years ago by richy_rich

No worries, I'm happy to help and starting with some of these tickets seems a good way to get familiar with the code/build/etc.

I've attached a new patch which removes the alert from both jpeg and jpeg2k translators and also cleans up other BAlert statements that the j2k translator could have popped up (replaced with logging to stderr, which is what the other translators seem to do).

comment:10 in reply to:  9 Changed 10 years ago by jackburton

Resolution: fixed
Status: newclosed

Replying to richy_rich:

Applied in hrev31873. Thanks!

Note: See TracTickets for help on using tickets.