# How to access SVG/PShape original width & height?

**URL:** <https://discourse.processing.org/t/how-to-access-svg-pshape-original-width-height/23027>\
**Category:** Coding Questions\
**Created:** [August 4, 2020, 7:40am UTC](https://discourse.processing.org/t/how-to-access-svg-pshape-original-width-height/23027 "2020-08-04T07:40:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ruchi](https://avatars.discourse-cdn.com/v4/letter/r/f475e1/32.png) [@Ruchi](https://discourse.processing.org/u/Ruchi)\
**Post date:** [August 4, 2020, 7:40am UTC](https://discourse.processing.org/t/how-to-access-svg-pshape-original-width-height/23027/1 "2020-08-04T07:40:53Z")

</div>

```auto
import processing.svg.*;

float reso;
void setup() {
  size(800, 800);
  reso = width;
  beginRecord(SVG,"a.svg");
}

void draw() {
  background(0);
  
  PVector center = new PVector(reso/2,reso-5);
  //float center = reso/2;
  float radius = reso/1.9;
  float xoff = reso/2.3;
  float yoff = reso/1.48;
  translate(center.x,center.y);
  //translate(0,-center.y+5);
  //rotate(PI);
  
  PVector point1 = new PVector(-xoff,-yoff);
  PVector point2 = new PVector(radius * cos(radians(230)), - yoff + radius * sin(radians(230)));
  PVector point3 = new PVector(radius * cos(radians(-50)), - yoff + radius * sin(radians(-50)));
  PVector point4 = new PVector(xoff,-yoff); 
  
  PShape s1 = createShape(PShape.PATH);
  s1.beginShape();
  s1.noStroke();
  s1.vertex(point1.x,point1.y);
  s1.bezierVertex(point2.x,point2.y,point3.x,point3.y,point4.x,point4.y);
  s1.vertex(xoff,0);
  s1.vertex(-xoff,0);
  s1.endShape(CLOSE);
  shape(s1,0,0);  
  endRecord();
  
}

```

```auto
PShape shape;

void setup(){
  size(800,800,P2D);
  shape = loadShape("a.svg");
  noLoop();
}

void draw(){
background(0);
translate(width/2,height-5);
shape(shape,0,0,500,250);
}

```

I want to access the shape’s original width & height and manipulate it when I import it maintaining the aspect ratio of the shape. But it kind of comes out distorted. When using the scale function , it accumulates as it changes the shape size directly causing the shape to get huge or disappear in few frames.  
Also the size is different when imported with P2D renderer and default renderer.
