Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.
 

Missing jpeg in XE2 and higher


#1

Hi,
I noticed that SmartInspect.pas uses jpeg unit. The point is that Delphi XE2 has changed namespaces, so there is no longer jpeg.dcu but VCL.imaging.jpeg.dcu.

In order to make it work, it is necessary:

  1. Add new define in SmartInspect.inc:


{$IF CompilerVersion >= 23}
{$DEFINE DELPHIXE2_OR_HIGHER}
{$IFEND}
{$IF CompilerVersion >= 24}
{$DEFINE DELPHIXE3_OR_HIGHER}
{$IFEND}

  1. Change SmartInpect.pas uses declaration:

{$IFNDEF SI_DISABLE_GRAPHIC}
{$IFDEF DELPHIXE2_OR_HIGHER}
VCL.Imaging.Jpeg,
{$ELSE}
Jpeg,
{$ENDIF}
{$ENDIF}

kind regards
Piotr Rezmer


#2

Hello Piotr,

Thanks for your posting. Do you have issues compiling SmartInspect because of this? I’m asking as we don’t have issues with this here and I suspect that Delphi usually uses an alias to map the old unit names to the new namespace (for backward compatibility).

Thanks.


#3

I have installed Delphi XE using ISO image from Embarcadero registered users download page. So it contains update 1. As far as “Tools|Options|Delphi Options| Library|unit scope name” it is empty by default. Project Options| Delphi Compiler| Unit Scope names contain:

Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde
System;Xml;Data;Datasnap;Web;Soap;Vcl;Winapi;System.Win;Data.Win

I didn’t change those values manually

I found the reason. The project was used under Delphi XE before. Probably when “Unit scope names” is already set (if project was used in earlier version of Delphi), XE2 will not update it.

If I create new project under XE2, it has following unit scope names:

Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell

This is why, there is no problem to use SmartInspect in brand new application under XE2.

Thanks for hint.

kind regards
Piotr Rezmer


#4

Thanks for the detailed feedback Piotr, it’s appreciated. We will still look into moving to the new namespaces in future updates where it makes sense (for new Delphi version only, obviously).

Regards,
Dennis