Cookies help us deliver our services. By using our services, you agree to our use of cookies.
Views

Changing Passport Image Dimensions and Size

From IHRIS Wiki

Jump to: navigation, search

In this tutorial we show how to resize the dimensions of the images you are uploading to iHRIS Manage or iHRIS Qualify. Take note that resizing the dimensions (width and length) goes further to reducing the image size.


Defining the form field

In order to be able to resize the image, we need to define the form field to be of type PASSPORT like here Now change the lines:

   <configurationGroup name="forms" path="/modules/forms">
     <configurationGroup name="formClasses">
       <configurationGroup name="iHRIS_Passport">
         <configurationGroup name="fields">
           <displayName>The fields defined for this form</displayName>
           <configurationGroup name="passport">
             <configurationGroup name="meta">
               <configuration name="max_height">
                 <value>128</value>
               </configuration>
               <configuration name="max_width">
                 <value>136</value>
               </configuration>
             </configurationGroup>
             <displayName>The field 'address'</displayName>
             <configuration name="formfield">
               <displayName>The form field type</displayName>
               <value>PASSPORT</value>
             </configuration>
             <configuration name="headers" type="delimited" locale="en_US">
               <displayName>The headers for this field.</displayName>
               <value>default:Passport</value>
             </configuration>
           </configurationGroup>
         </configurationGroup>
       </configurationGroup>
     </configurationGroup>
   </configurationGroup>

Changing the dimensions

In order to change the dimensions, you need to include a meta tag when defining the field. In it you specify the maximum width and maximum height for the passport photo. However if you don't need to affect the dimensions i.e. height and width you set the values for max_height and max_width equal to zero. Setting these values to zero only affects the size of the image and keeps the dimensions from the original image.