Among a context of three pixels, the present JPEG-LS produces predicted values based on whether a vertical edge or a horizontal edge is detected. When a diagonal edge exists, however, experiments and observation reveal that such a prediction will generate large predictive errors. By applying the triangle inequality to the analysis of predictive templates in JpEG-LS, we propose a diagonal-edge detection scheme to reduce the predictive error and hence provide an improvement on the prediction accuracy. Experiments are carried out to test the proposed scheme for a group of sample images. In comparison with the current JPEG-LS prediction, our scheme produces lower prediction errors, in terms of both MSE measurement and visual comparison of error images.