In this paper, we propose a reversible steganographic algorithm for compressed images. The algorithm firstly compresses the input image using block truncation coding. One binary map and two quantisation levels, called high and low levels, are then obtained for each block. Thereafter, we adopt a median edge detector to predict the high and low quantisation levels for neighbouring blocks. A secret message is then embedded into the predicted difference based on the difference expansion technique. Each block can be classified as embeddable and non-embeddable according to the order of two quantisation levels. Thus, the location map is unnecessary in our proposed algorithm. The experimental results show that our data-embedded compressed code can be the same file size compared with standard block truncation coding-compressed code. Our algorithm can also resist the RS steganalysis attack. Further, the embedding capacity can be varied according to the given embedding parameter. The feasibility of our proposed algorithm is validated by presenting comparisons with existing algorithms.